From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [for-next] NULL pointer dereference in codec probe Date: Thu, 30 Apr 2015 15:31:33 +0200 Message-ID: References: <87fv7i9bgu.fsf@intel.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id D683B2615F7 for ; Thu, 30 Apr 2015 15:31:33 +0200 (CEST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: "Jie, Yang" Cc: "Nikula, Jani" , "alsa-devel@alsa-project.org" , "Tian, YeX" List-Id: alsa-devel@alsa-project.org At Thu, 30 Apr 2015 12:27:52 +0000, Jie, Yang wrote: > > > -----Original Message----- > > From: Jie, Yang > > Sent: Thursday, April 30, 2015 7:08 PM > > To: 'Takashi Iwai'; Nikula, Jani > > Cc: Jaroslav Kysela; alsa-devel@alsa-project.org; Tian, YeX > > Subject: RE: [for-next] NULL pointer dereference in codec probe > > > > > -----Original Message----- > > > From: Takashi Iwai [mailto:tiwai@suse.de] > > > Sent: Thursday, April 30, 2015 6:23 PM > > > To: Nikula, Jani > > > Cc: Jaroslav Kysela; alsa-devel@alsa-project.org; Tian, YeX; Jie, Yang > > > Subject: Re: [for-next] NULL pointer dereference in codec probe > > > > > > At Thu, 30 Apr 2015 13:06:41 +0300, > > > Jani Nikula wrote: > > > > > > > > > > > > Hi all, our graphics QA found an issue [1] with the for-next branch > > > > of [2] merged on top of v4.1-rc1. Backtrace in the bug. I didn't > > > > really have time to look into the details, but just letting you know. > > > > > > Looks like the new jack stuff broke something. Keyon, could you take a > > look? > > > > I noticed this today and root caused it. Will provide a patch for it tomorrow. > > I just worked out a patch[1] to fix it. no chance to test it yet. > will send it to ML once it passed my testing tomorrow. > > [1] https://bugs.freedesktop.org/attachment.cgi?id=115474 I could reproduce the problem on my machine, and checked your patch. It's good per se, but it doesn't suffice. We have to cover all jack->input_dev accesses. The additional fix patch is attached below. Since the bug is fixed by these patches, I'm going to queue them to topic/jack and for-next branch. thanks, Takashi -- 8< -- From: Takashi Iwai Subject: [PATCH] ALSA: jack: Fix another NULL dereference due to empty input jack Another fixes for NULL jack->input_dev in some places in jack.c. Fixes: 2ba2dfa1fcc7 ('ALSA: hda - Update to use the new jack kctls method') Signed-off-by: Takashi Iwai --- sound/core/jack.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/core/jack.c b/sound/core/jack.c index 0dbd618e3c94..eb66327b5f1c 100644 --- a/sound/core/jack.c +++ b/sound/core/jack.c @@ -87,6 +87,10 @@ static int snd_jack_dev_register(struct snd_device *device) snprintf(jack->name, sizeof(jack->name), "%s %s", card->shortname, jack->id); + + if (!jack->input_dev) + return 0; + jack->input_dev->name = jack->name; /* Default to the sound card device. */ @@ -278,6 +282,8 @@ EXPORT_SYMBOL(snd_jack_new); void snd_jack_set_parent(struct snd_jack *jack, struct device *parent) { WARN_ON(jack->registered); + if (!jack->input_dev) + return; jack->input_dev->dev.parent = parent; } -- 2.3.6