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

Takashi Iwai tiwai at suse.de
Mon Apr 4 12:38:53 CEST 2011


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.


thanks,

Takashi


More information about the Alsa-devel mailing list