Commit 8cd73ce7 authored by Keyon Jie's avatar Keyon Jie Committed by Mark Brown

ASoC: SOF: topology: fix missing NULL pointer check

Add check to avoid possible NULL pointer dereference issue.

This issue was reported by static analysis tools, we didn't face this
issue but we can't rule it out either as a false positive.
Reported-by: default avatarKeqiao Zhang <keqiao.zhang@intel.com>
Signed-off-by: default avatarKeyon Jie <yang.jie@linux.intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191101170916.26517-2-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent bd0b609e
...@@ -150,6 +150,11 @@ static int sof_keyword_dapm_event(struct snd_soc_dapm_widget *w, ...@@ -150,6 +150,11 @@ static int sof_keyword_dapm_event(struct snd_soc_dapm_widget *w,
/* get runtime PCM params using widget's stream name */ /* get runtime PCM params using widget's stream name */
spcm = snd_sof_find_spcm_name(sdev, swidget->widget->sname); spcm = snd_sof_find_spcm_name(sdev, swidget->widget->sname);
if (!spcm) {
dev_err(sdev->dev, "error: cannot find PCM for %s\n",
swidget->widget->name);
return -EINVAL;
}
/* process events */ /* process events */
switch (event) { switch (event) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment