ASoC: dapm: fix error path in snd_soc_dapm_new_pcm
authoranish kumar <yesanishhere@gmail.com>
Wed, 20 Sep 2017 08:28:33 +0000 (01:28 -0700)
committerMark Brown <broonie@kernel.org>
Wed, 20 Sep 2017 11:38:46 +0000 (12:38 +0100)
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>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-dapm.c

index dcef67a9bd4854a29c79ad8355343c5f16ae76a2..f51f61340f9c1c2004a596dedc0287aea64a87ae 100644 (file)
@@ -3907,9 +3907,9 @@ outfree_private_value:
        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;