mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] usb-audio: Check for possible chip NULL pointer before clearing probing flag
@ 2011-09-26 13:43 Thomas Pfaff
  2011-09-26 13:52 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Pfaff @ 2011-09-26 13:43 UTC (permalink / raw)
  To: tiwai, gregkh; +Cc: linux-kernel, alsa-devel

Before clearing the probing flag in the error exit path, check that the 
chip pointer is not NULL.

Signed-off-by: Thomas Pfaff <tpfaff@gmx.net>

---
diff -urp a/sound/usb/card.c b/sound/usb/card.c
--- a/sound/usb/card.c	2011-09-26 14:58:02.468672118 +0200
+++ b/sound/usb/card.c	2011-09-26 15:00:30.313110086 +0200
@@ -530,9 +530,11 @@ snd_usb_audio_probe(struct usb_device *d
 	return chip;
 
  __error:
-	if (chip && !chip->num_interfaces)
-		snd_card_free(chip->card);
-	chip->probing = 0;
+	if (chip) {
+		if (!chip->num_interfaces)
+			snd_card_free(chip->card);
+		chip->probing = 0;
+	}
 	mutex_unlock(&register_mutex);
  __err_val:
 	return NULL;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] usb-audio: Check for possible chip NULL pointer before clearing probing flag
  2011-09-26 13:43 [PATCH] usb-audio: Check for possible chip NULL pointer before clearing probing flag Thomas Pfaff
@ 2011-09-26 13:52 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2011-09-26 13:52 UTC (permalink / raw)
  To: Thomas Pfaff; +Cc: gregkh, linux-kernel, alsa-devel

At Mon, 26 Sep 2011 15:43:59 +0200 (CEST),
Thomas Pfaff wrote:
> 
> Before clearing the probing flag in the error exit path, check that the 
> chip pointer is not NULL.
> 
> Signed-off-by: Thomas Pfaff <tpfaff@gmx.net>

Applied now.  Thanks.


Takashi


> ---
> diff -urp a/sound/usb/card.c b/sound/usb/card.c
> --- a/sound/usb/card.c	2011-09-26 14:58:02.468672118 +0200
> +++ b/sound/usb/card.c	2011-09-26 15:00:30.313110086 +0200
> @@ -530,9 +530,11 @@ snd_usb_audio_probe(struct usb_device *d
>  	return chip;
>  
>   __error:
> -	if (chip && !chip->num_interfaces)
> -		snd_card_free(chip->card);
> -	chip->probing = 0;
> +	if (chip) {
> +		if (!chip->num_interfaces)
> +			snd_card_free(chip->card);
> +		chip->probing = 0;
> +	}
>  	mutex_unlock(&register_mutex);
>   __err_val:
>  	return NULL;
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-09-26 13:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-26 13:43 [PATCH] usb-audio: Check for possible chip NULL pointer before clearing probing flag Thomas Pfaff
2011-09-26 13:52 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®