diff mbox

[Resend,1/4] ASoC: dapm: fix error path in snd_soc_dapm_new_pcm

Message ID 1505896116-43310-2-git-send-email-yesanishhere@gmail.com (mailing list archive)
State Accepted
Commit e5af4f9fb3d405e6145f0d019ce11a97a8930915
Headers show

Commit Message

Anish Kumar Sept. 20, 2017, 8:28 a.m. UTC
From: anish kumar <yesanishhere@gmail.com>

w_param_text[count] is freed in the wrong error path.
Fix it by shifting the outfree_w_param label.

Signed-off-by: anish kumar <yesanishhere@gmail.com>
---
 sound/soc/soc-dapm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Charles Keepax Sept. 20, 2017, 11:02 a.m. UTC | #1
On Wed, Sep 20, 2017 at 01:28:33AM -0700, yesanishhere@gmail.com wrote:
> From: anish kumar <yesanishhere@gmail.com>
> 
> w_param_text[count] is freed in the wrong error path.
> Fix it by shifting the outfree_w_param label.
> 
> Signed-off-by: anish kumar <yesanishhere@gmail.com>
> ---

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles
diff mbox

Patch

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index dcef67a..f51f613 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3907,9 +3907,9 @@  int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
 	devm_kfree(card->dev, (void *)private_value);
 outfree_link_name:
 	devm_kfree(card->dev, link_name);
-outfree_w_param:
 	for (count = 0 ; count < num_params; count++)
 		devm_kfree(card->dev, (void *)w_param_text[count]);
+outfree_w_param:
 	devm_kfree(card->dev, w_param_text);
 
 	return ret;