OSDN Git Service

ALSA: usb-audio: Check for possible chip NULL pointer before clearing probing flag
authorThomas Pfaff <tpfaff@gmx.net>
Mon, 26 Sep 2011 13:43:59 +0000 (15:43 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 3 Oct 2011 18:41:08 +0000 (11:41 -0700)
commit 61a6a108d15213f5ee06332e1e7766d3860e4453 upstream.

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>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
sound/usb/card.c

index 29b3094..57a8e2d 100644 (file)
@@ -529,9 +529,11 @@ static void *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(&register_mutex);
  __err_val:
        return NULL;