[alsa-devel] [PATCH 3/3 v4] alsa-lib: fixed coverity reported issues under "USE_AFTER_FREE" checker.

Sudarshan Bisht sudarshan.bisht at nokia.com
Tue Apr 5 09:44:15 CEST 2011


On Mon, 2011-04-04 at 12:38 +0200, ext Takashi Iwai wrote:
> At Mon,  4 Apr 2011 13:04:02 +0300,
> sudarshan.bisht at nokia.com wrote:
> > 
> > diff --git a/src/mixer/simple_abst.c b/src/mixer/simple_abst.c
> > index 9e9aaf5..c722b02 100644
> > --- a/src/mixer/simple_abst.c
> > +++ b/src/mixer/simple_abst.c
> > @@ -336,6 +336,8 @@ int snd_mixer_simple_basic_register(snd_mixer_t *mixer,
> >  		err = find_module(class, top);
> >  	if (err >= 0)
> >  		err = snd_mixer_attach_hctl(mixer, priv->hctl);
> > +		if (err < 0)
> > +			goto __error;
> >  	if (err >= 0) {
> >  		priv->attach_flag = 1;
> >  		err = snd_mixer_class_register(class, mixer);
> 
> You need braces.
> But, actually this check isn't needed.  If you follow the code below
> there, it reaches to __error properly when err < 0.
   Yes, there is no need of this check.   
> 
> thanks,
> 
> Takashi


Thanks,

Sudarshan 



More information about the Alsa-devel mailing list