* Question on fe_dai_open
@ 2014-07-18 12:11 gsantosh
2014-07-19 13:14 ` gsantosh
0 siblings, 1 reply; 2+ messages in thread
From: gsantosh @ 2014-07-18 12:11 UTC (permalink / raw)
To: alsa-devel; +Cc: Mark Brown, lgirdwood
Hi All,
In the following function
dpcm_fe_dai_open
Why the code is proceeding further if dpcm_path_get returns zero,
if dpcm_path_get returns zero implies there is no vaild path setup.
technically we should return from the function when there is no valid path
setup, still we proceed further de-referencing the pointer at the exit of
this function through dpcm_path_put(&list);
please let me know why we are not returning when dpcm_path_get returns zero.
static int dpcm_fe_dai_open(struct snd_pcm_substream *fe_substream)
{
....
if (dpcm_path_get(fe, stream, &list) <= 0) {
dev_dbg(fe->dev, "ASoC: %s no valid %s route\n",
fe->dai_link->name, stream ? "capture" :
"playback");
/*we need to return if there is no vaild paths available*/
}
....
dpcm_path_put(&list);
}
Regards
Santosh M G
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: Question on fe_dai_open
2014-07-18 12:11 Question on fe_dai_open gsantosh
@ 2014-07-19 13:14 ` gsantosh
0 siblings, 0 replies; 2+ messages in thread
From: gsantosh @ 2014-07-19 13:14 UTC (permalink / raw)
To: gsantosh; +Cc: alsa-devel, Mark Brown, lgirdwood
Hi All,
Please help me on this question.
Regards,
Santosh M G.
> Hi All,
>
> In the following function
>
> dpcm_fe_dai_open
>
> Why the code is proceeding further if dpcm_path_get returns zero,
> if dpcm_path_get returns zero implies there is no vaild path setup.
>
> technically we should return from the function when there is no valid path
> setup, still we proceed further de-referencing the pointer at the exit of
> this function through dpcm_path_put(&list);
>
> please let me know why we are not returning when dpcm_path_get returns
> zero.
>
>
> static int dpcm_fe_dai_open(struct snd_pcm_substream *fe_substream)
> {
> ....
> if (dpcm_path_get(fe, stream, &list) <= 0) {
> dev_dbg(fe->dev, "ASoC: %s no valid %s route\n",
> fe->dai_link->name, stream ? "capture" :
> "playback");
>
> /*we need to return if there is no vaild paths available*/
> }
> ....
> dpcm_path_put(&list);
> }
>
> Regards
> Santosh M G
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-19 13:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-18 12:11 Question on fe_dai_open gsantosh
2014-07-19 13:14 ` gsantosh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox