From: Thomas Pfaff <tpfaff@gmx.net> Date: Mon, 26 Sep 2011 13:43:59 +0000 (+0200) Subject: ALSA: usb-audio: Check for possible chip NULL pointer before clearing probing flag X-Git-Tag: v3.1-rc8~1^2~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=61a6a108d15213f5ee06332e1e7766d3860e4453;p=users%2Fjedix%2Flinux-maple.git ALSA: usb-audio: Check for possible chip NULL pointer before clearing probing flag 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> Cc: <stable@kernel.org> [2.6.39+] Signed-off-by: Takashi Iwai <tiwai@suse.de> --- diff --git a/sound/usb/card.c b/sound/usb/card.c index ed120ca2353d..d8f2bf401458 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c @@ -530,9 +530,11 @@ snd_usb_audio_probe(struct usb_device *dev, 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(®ister_mutex); __err_val: return NULL;