mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 12:35:52 +02:00
ASoC: SOF: topology: fix possible dereference
reported by cppcheck
sound/soc/sof/topology.c:141:36: warning: Either the condition
'!swidget' is redundant or there is possible null pointer dereference:
swidget. [nullPointerRedundantCheck]
struct snd_soc_component *scomp = swidget->scomp;
^
sound/soc/sof/topology.c:146:6: note: Assuming that condition
'!swidget' is not redundant
if (!swidget)
^
sound/soc/sof/topology.c:141:36: note: Null pointer dereference struct
snd_soc_component *scomp = swidget->scomp;
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
This commit is contained in:
parent
67d5328f9f
commit
b717ef00ea
|
|
@ -138,7 +138,7 @@ static int sof_keyword_dapm_event(struct snd_soc_dapm_widget *w,
|
|||
struct snd_kcontrol *k, int event)
|
||||
{
|
||||
struct snd_sof_widget *swidget = w->dobj.private;
|
||||
struct snd_soc_component *scomp = swidget->scomp;
|
||||
struct snd_soc_component *scomp;
|
||||
int stream = SNDRV_PCM_STREAM_CAPTURE;
|
||||
struct snd_sof_pcm *spcm;
|
||||
int ret = 0;
|
||||
|
|
@ -146,6 +146,8 @@ static int sof_keyword_dapm_event(struct snd_soc_dapm_widget *w,
|
|||
if (!swidget)
|
||||
return 0;
|
||||
|
||||
scomp = swidget->scomp;
|
||||
|
||||
dev_dbg(scomp->dev, "received event %d for widget %s\n",
|
||||
event, w->name);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user