diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2013-07-25 11:25:47 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 13:33:37 -0700 |
commit | ec51e685f2b5735b2714afccb8c810cc81e4a888 (patch) | |
tree | 5a1e74942ef07f8fa82b39b65422887d9faf8da4 /sound | |
parent | 92e90e95d4743866d0cfa106dd17c40d47690273 (diff) |
asoc: tegra: fix Coverity issues of resource leak
- add kfree in error paths which can result into
possible memory leak
Coverity id : 23675
Coverity id : 23676
Coverity id : 23747
Bug 1329327
Change-Id: Ie2f27029cd3c72cf35f29877a4935f7b22887665
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/253227
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/tegra/tegra_pcm.c | 1 | ||||
-rw-r--r-- | sound/soc/tegra/tegra_rt5639.c | 2 | ||||
-rw-r--r-- | sound/soc/tegra/tegra_rt5645.c | 2 |
3 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c index 8f0f98705103..2b335a7073af 100644 --- a/sound/soc/tegra/tegra_pcm.c +++ b/sound/soc/tegra/tegra_pcm.c @@ -80,6 +80,7 @@ static int tegra_pcm_open(struct snd_pcm_substream *substream) ret = snd_dmaengine_pcm_open_request_chan(substream, NULL, NULL); if (ret) { dev_err(dev, "dmaengine pcm open failed with err %d\n", ret); + kfree(prtd); return ret; } diff --git a/sound/soc/tegra/tegra_rt5639.c b/sound/soc/tegra/tegra_rt5639.c index 5cc24cfb5c1e..babd8af42e77 100644 --- a/sound/soc/tegra/tegra_rt5639.c +++ b/sound/soc/tegra/tegra_rt5639.c @@ -871,6 +871,8 @@ static int tegra_rt5639_driver_probe(struct platform_device *pdev) machine = kzalloc(sizeof(struct tegra_rt5639), GFP_KERNEL); if (!machine) { dev_err(&pdev->dev, "Can't allocate tegra_rt5639 struct\n"); + if (np) + kfree(pdata); return -ENOMEM; } diff --git a/sound/soc/tegra/tegra_rt5645.c b/sound/soc/tegra/tegra_rt5645.c index a1d8afe94ba0..73ea79d7ea7a 100644 --- a/sound/soc/tegra/tegra_rt5645.c +++ b/sound/soc/tegra/tegra_rt5645.c @@ -877,6 +877,8 @@ static int tegra_rt5645_driver_probe(struct platform_device *pdev) machine = kzalloc(sizeof(struct tegra_rt5645), GFP_KERNEL); if (!machine) { dev_err(&pdev->dev, "Can't allocate tegra_rt5645 struct\n"); + if (np) + kfree(pdata); return -ENOMEM; } |