ソースを参照

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>
Thomas Pfaff 13 年 前
コミット
61a6a108d1
1 ファイル変更5 行追加3 行削除
  1. 5 3
      sound/usb/card.c

+ 5 - 3
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(&register_mutex);
  __err_val:
 	return NULL;