ASoC: qcom: lpass-platform: Fix memory leak
[ Upstream commitbd6327fda2
] lpass_pcm_data is not freed in error paths. Free it in error paths to avoid memory leak. Fixes:022d00ee0b
("ASoC: lpass-platform: Fix broken pcm data usage") Signed-off-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: V Sujith Kumar Reddy <vsujithk@codeaurora.org> Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org> Link: https://lore.kernel.org/r/1605416210-14530-1-git-send-email-srivasam@codeaurora.org Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
24ce39bf0a
commit
32ebbc8469
|
@ -73,8 +73,10 @@ static int lpass_platform_pcmops_open(struct snd_pcm_substream *substream)
|
||||||
else
|
else
|
||||||
dma_ch = 0;
|
dma_ch = 0;
|
||||||
|
|
||||||
if (dma_ch < 0)
|
if (dma_ch < 0) {
|
||||||
|
kfree(data);
|
||||||
return dma_ch;
|
return dma_ch;
|
||||||
|
}
|
||||||
|
|
||||||
drvdata->substream[dma_ch] = substream;
|
drvdata->substream[dma_ch] = substream;
|
||||||
|
|
||||||
|
@ -95,6 +97,7 @@ static int lpass_platform_pcmops_open(struct snd_pcm_substream *substream)
|
||||||
ret = snd_pcm_hw_constraint_integer(runtime,
|
ret = snd_pcm_hw_constraint_integer(runtime,
|
||||||
SNDRV_PCM_HW_PARAM_PERIODS);
|
SNDRV_PCM_HW_PARAM_PERIODS);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
kfree(data);
|
||||||
dev_err(soc_runtime->dev, "setting constraints failed: %d\n",
|
dev_err(soc_runtime->dev, "setting constraints failed: %d\n",
|
||||||
ret);
|
ret);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
Loading…
Reference in New Issue