Skip to content

Commit

Permalink
ALSA: usb-audio: Check for possible chip NULL pointer before clearing…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
Thomas Pfaff authored and Takashi Iwai committed Sep 26, 2011
1 parent e0d32e3 commit 61a6a10
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sound/usb/card.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 61a6a10

Please sign in to comment.