From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751625Ab1IZNwY (ORCPT ); Mon, 26 Sep 2011 09:52:24 -0400 Received: from cantor2.suse.de ([195.135.220.15]:45620 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751305Ab1IZNwX (ORCPT ); Mon, 26 Sep 2011 09:52:23 -0400 Date: Mon, 26 Sep 2011 15:52:20 +0200 Message-ID: From: Takashi Iwai To: Thomas Pfaff Cc: gregkh@suse.de, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: Re: [PATCH] usb-audio: Check for possible chip NULL pointer before clearing probing flag In-Reply-To: References: User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Mon, 26 Sep 2011 15:43:59 +0200 (CEST), Thomas Pfaff wrote: > > Before clearing the probing flag in the error exit path, check that the > chip pointer is not NULL. > > Signed-off-by: Thomas Pfaff Applied now. Thanks. Takashi > --- > 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; >