* Re: ASoC: dpcm: Add debugFS support for DPCM
@ 2012-04-29 13:51 Dan Carpenter
2012-04-30 10:05 ` Liam Girdwood
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-04-29 13:51 UTC (permalink / raw)
To: lrg; +Cc: alsa-devel
Hello Liam Girdwood,
The patch f86dcef87b77: "ASoC: dpcm: Add debugFS support for DPCM"
from Apr 25, 2012, leads to the following Smatch warning:
sound/soc/soc-core.c:1221 soc_post_component_init()
error: potential null derefence 'dai_link'.
1143 static int soc_post_component_init(struct snd_soc_card *card,
1144 struct snd_soc_codec *codec,
1145 int num, int dailess)
1146 {
1147 struct snd_soc_dai_link *dai_link = NULL;
1148 struct snd_soc_aux_dev *aux_dev = NULL;
1149 struct snd_soc_pcm_runtime *rtd;
1150 const char *temp, *name;
1151 int ret = 0;
1152
1153 if (!dailess) {
1154 dai_link = &card->dai_link[num];
^^^^^^^^
dai_link is only set sometimes; it depends on dailess.
1155 rtd = &card->rtd[num];
1156 name = dai_link->name;
1157 } else {
1158 aux_dev = &card->aux_dev[num];
1159 rtd = &card->rtd_aux[num];
1160 name = aux_dev->name;
1161 }
[snip]
1219 #ifdef CONFIG_DEBUG_FS
1220 /* add DPCM sysfs entries */
1221 if (!dai_link->dynamic)
^^^^^^^^^^
Smatch complains about this.
1222 goto out;
1223
1224 ret = soc_dpcm_debugfs_add(rtd);
1225 if (ret < 0)
1226 dev_err(rtd->dev, "asoc: failed to add dpcm sysfs entries: %d\n", ret);
1227
1228 out:
1229 #endif
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: ASoC: dpcm: Add debugFS support for DPCM
2012-04-29 13:51 ASoC: dpcm: Add debugFS support for DPCM Dan Carpenter
@ 2012-04-30 10:05 ` Liam Girdwood
0 siblings, 0 replies; 2+ messages in thread
From: Liam Girdwood @ 2012-04-30 10:05 UTC (permalink / raw)
To: Dan Carpenter; +Cc: alsa-devel
On Sun, 2012-04-29 at 16:51 +0300, Dan Carpenter wrote:
> Hello Liam Girdwood,
>
> The patch f86dcef87b77: "ASoC: dpcm: Add debugFS support for DPCM"
> from Apr 25, 2012, leads to the following Smatch warning:
> sound/soc/soc-core.c:1221 soc_post_component_init()
> error: potential null derefence 'dai_link'.
>
Fix sent to list.
Thanks
Liam
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-04-30 10:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-29 13:51 ASoC: dpcm: Add debugFS support for DPCM Dan Carpenter
2012-04-30 10:05 ` Liam Girdwood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).