提交 9356e9d5 编写于 作者: L Lars-Peter Clausen 提交者: Mark Brown

ASoC: dapm: Check return value of snd_soc_cnew()

snd_soc_cnew() can return NULL, so we should check the result before trying to
use it.
Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 46a02c97
...@@ -671,8 +671,10 @@ static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w, ...@@ -671,8 +671,10 @@ static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w,
kcontrol = snd_soc_cnew(&w->kcontrol_news[kci], NULL, name, kcontrol = snd_soc_cnew(&w->kcontrol_news[kci], NULL, name,
prefix); prefix);
kcontrol->private_free = dapm_kcontrol_free;
kfree(long_name); kfree(long_name);
if (!kcontrol)
return -ENOMEM;
kcontrol->private_free = dapm_kcontrol_free;
ret = dapm_kcontrol_data_alloc(w, kcontrol); ret = dapm_kcontrol_data_alloc(w, kcontrol);
if (ret) { if (ret) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册