[alsa-devel] [patch] move dereference after null check

Liam Girdwood lrg at slimlogic.co.uk
Mon Nov 16 11:36:49 CET 2009


On Mon, 2009-11-16 at 11:06 +0200, Dan Carpenter wrote:
> The 'jack' variable was dereference before the NULL check so this patch 
> moves the dereference later.
> 
> regards,
> dan carpenter
> 
> Signed-off-by: Dan Carpenter <error27 at gmail.com>
Acked-by: Liam Girdwood <lrg at slimlogic.co.uk>

> 
> --- orig/sound/soc/soc-jack.c	2009-11-14 11:04:04.000000000 +0200
> +++ devel/sound/soc/soc-jack.c	2009-11-14 11:05:01.000000000 +0200
> @@ -58,7 +58,7 @@
>   */
>  void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask)
>  {
> -	struct snd_soc_codec *codec = jack->card->codec;
> +	struct snd_soc_codec *codec;
>  	struct snd_soc_jack_pin *pin;
>  	int enable;
>  	int oldstatus;
> @@ -67,6 +67,7 @@
>  		WARN_ON_ONCE(!jack);
>  		return;
>  	}
> +	codec = jack->card->codec;
>  
>  	mutex_lock(&codec->mutex);
>  




More information about the Alsa-devel mailing list