* Re: ASoC: Intel: mrfld: add DSP core controls
@ 2014-10-29 15:14 Dan Carpenter
2014-11-03 5:45 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2014-10-29 15:14 UTC (permalink / raw)
To: vinod.koul; +Cc: alsa-devel
Hello Vinod Koul,
The patch 24c8d14192cc: "ASoC: Intel: mrfld: add DSP core controls"
from Oct 15, 2014, leads to the following static checker warning:
sound/soc/intel/sst-atom-controls.c:1354 sst_map_modules_to_pipe()
warn: variable dereferenced before check 'platform' (see line 1353)
sound/soc/intel/sst-atom-controls.c
1348 static int sst_map_modules_to_pipe(struct snd_soc_platform *platform)
1349 {
1350 struct snd_soc_dapm_widget *w;
1351 int ret = 0;
1352
1353 list_for_each_entry(w, &platform->component.card->widgets, list) {
^^^^^^^^
New dereference.
1354 if (platform && is_sst_dapm_widget(w) && (w->priv)) {
^^^^^^^^
New check.
1355 struct sst_ids *ids = w->priv;
1356
1357 dev_dbg(platform->dev, "widget type=%d name=%s\n",
1358 w->id, w->name);
1359 INIT_LIST_HEAD(&ids->algo_list);
1360 INIT_LIST_HEAD(&ids->gain_list);
1361 ret = sst_fill_widget_module_info(w, platform);
1362
1363 if (ret < 0)
1364 return ret;
1365
1366 /* fill linked widgets */
1367 if (ids->parent_wname != NULL)
1368 sst_fill_linked_widgets(platform, ids);
1369 }
1370 }
1371 return 0;
1372 }
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: ASoC: Intel: mrfld: add DSP core controls
2014-10-29 15:14 ASoC: Intel: mrfld: add DSP core controls Dan Carpenter
@ 2014-11-03 5:45 ` Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2014-11-03 5:45 UTC (permalink / raw)
To: Dan Carpenter; +Cc: alsa-devel
On Wed, Oct 29, 2014 at 06:14:57PM +0300, Dan Carpenter wrote:
> Hello Vinod Koul,
>
> The patch 24c8d14192cc: "ASoC: Intel: mrfld: add DSP core controls"
> from Oct 15, 2014, leads to the following static checker warning:
>
> sound/soc/intel/sst-atom-controls.c:1354 sst_map_modules_to_pipe()
> warn: variable dereferenced before check 'platform' (see line 1353)
>
> sound/soc/intel/sst-atom-controls.c
> 1348 static int sst_map_modules_to_pipe(struct snd_soc_platform *platform)
> 1349 {
> 1350 struct snd_soc_dapm_widget *w;
> 1351 int ret = 0;
> 1352
> 1353 list_for_each_entry(w, &platform->component.card->widgets, list) {
> ^^^^^^^^
> New dereference.
>
> 1354 if (platform && is_sst_dapm_widget(w) && (w->priv)) {
> ^^^^^^^^
> New check.
Thanks Dan,
This check is not required as the only user of this function does feref
'platfomr' before calling so we cna remove this. I will send a patch.
Thanks for reporting
--
~Vinod
>
> 1355 struct sst_ids *ids = w->priv;
> 1356
> 1357 dev_dbg(platform->dev, "widget type=%d name=%s\n",
> 1358 w->id, w->name);
> 1359 INIT_LIST_HEAD(&ids->algo_list);
> 1360 INIT_LIST_HEAD(&ids->gain_list);
> 1361 ret = sst_fill_widget_module_info(w, platform);
> 1362
> 1363 if (ret < 0)
> 1364 return ret;
> 1365
> 1366 /* fill linked widgets */
> 1367 if (ids->parent_wname != NULL)
> 1368 sst_fill_linked_widgets(platform, ids);
> 1369 }
> 1370 }
> 1371 return 0;
> 1372 }
>
> regards,
> dan carpenter
--
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-03 6:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-29 15:14 ASoC: Intel: mrfld: add DSP core controls Dan Carpenter
2014-11-03 5:45 ` Vinod Koul
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.