summary refs log tree commit diff
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-07-31 11:52:44 +0300
committerMark Brown <broonie@linaro.org>2013-07-31 12:19:25 +0100
commit46a02c978fbc79de856d0fe7a8c1d4fc620796e0 (patch)
tree4819c58be76a1c2b9ea19ef1aa0d9bed94ae5318 /sound/soc/soc-dapm.c
parent39eb5fd13dff8d3d04489fe3f59e0d22bf89041e (diff)
downloadlinux-46a02c978fbc79de856d0fe7a8c1d4fc620796e0.tar.gz
ASoC: dapm: using freed pointer in dapm_kcontrol_add_widget()
There is a typo here so we end up using the old freed pointer instead of
the newly allocated one.  (If the "n" is zero then the code works,
obviously).

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 9abb3b21f1fd..d74c3560d556 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -225,13 +225,13 @@ static int dapm_kcontrol_add_widget(struct snd_kcontrol *kcontrol,
 
 	new_data = krealloc(data, sizeof(*data) + sizeof(widget) * n,
 		GFP_KERNEL);
-	if (!data)
+	if (!new_data)
 		return -ENOMEM;
 
-	data->wlist.widgets[n - 1] = widget;
-	data->wlist.num_widgets = n;
+	new_data->wlist.widgets[n - 1] = widget;
+	new_data->wlist.num_widgets = n;
 
-	kcontrol->private_data = data;
+	kcontrol->private_data = new_data;
 
 	return 0;
 }