Re: [PATCH] ALSA: pcm_native: remove unused label

From: Sven Wegener
Date: Sun Aug 03 2008 - 13:33:39 EST


On Sun, 3 Aug 2008, Sven Wegener wrote:

> On Sun, 3 Aug 2008, Marcin Slusarz wrote:
>
> > gcc warns about it:
> > sound/core/pcm_native.c: In function 'snd_pcm_fasync':
> > sound/core/pcm_native.c:3262: warning: label 'out' defined but not used
> >
> > Signed-off-by: Marcin Slusarz <marcin.slusarz@xxxxxxxxx>
> > Cc: Takashi Iwai <tiwai@xxxxxxx>
> > Cc: Jaroslav Kysela <perex@xxxxxxxx>
> > ---
> > sound/core/pcm_native.c | 1 -
> > 1 files changed, 0 insertions(+), 1 deletions(-)
> >
> > diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
> > index c49b9d9..333cff6 100644
> > --- a/sound/core/pcm_native.c
> > +++ b/sound/core/pcm_native.c
> > @@ -3259,7 +3259,6 @@ static int snd_pcm_fasync(int fd, struct file * file, int on)
> > runtime = substream->runtime;
> >
> > err = fasync_helper(fd, file, on, &runtime->fasync);
> > -out:
> > unlock_kernel();
> > if (err < 0)
> > return err;
>
> Uhm, no, there's
>
> snd_assert(substream != NULL, goto out);
>
> one line above your context.

And that is broken. That's not what an assert is for, we access
substream->runtime a line later and that will blow up. That should be a
simpe if, instead of an assert.

Sven
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/