From: Thomas Pfaff <tpfaff@gmx.net>
To: tiwai@suse.de, gregkh@suse.de
Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org
Subject: [PATCH] usb-audio: Check for possible chip NULL pointer before clearing probing flag
Date: Mon, 26 Sep 2011 15:43:59 +0200 (CEST) [thread overview]
Message-ID: <alpine.LNX.2.00.1109261529160.10952@lxtpfaff.pcs.ditec.de> (raw)
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(®ister_mutex);
__err_val:
return NULL;
next reply other threads:[~2011-09-26 13:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-26 13:43 Thomas Pfaff [this message]
2011-09-26 13:52 ` Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LNX.2.00.1109261529160.10952@lxtpfaff.pcs.ditec.de \
--to=tpfaff@gmx.net \
--cc=alsa-devel@alsa-project.org \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®