Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [for-next] NULL pointer dereference in codec probe
@ 2015-04-30 10:06 Jani Nikula
  2015-04-30 10:23 ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Jani Nikula @ 2015-04-30 10:06 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, alsa-devel; +Cc: yex.tian


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.

BR,
Jani.


[1] https://bugs.freedesktop.org/show_bug.cgi?id=90229
[2] git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git


-- 
Jani Nikula, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [for-next] NULL pointer dereference in codec probe
  2015-04-30 10:06 [for-next] NULL pointer dereference in codec probe Jani Nikula
@ 2015-04-30 10:23 ` Takashi Iwai
  2015-04-30 11:07   ` Jie, Yang
  2015-04-30 12:27   ` Jie, Yang
  0 siblings, 2 replies; 6+ messages in thread
From: Takashi Iwai @ 2015-04-30 10:23 UTC (permalink / raw)
  To: Jani Nikula; +Cc: alsa-devel, yex.tian

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?


thanks,

Takashi


> 
> BR,
> Jani.
> 
> 
> [1] https://bugs.freedesktop.org/show_bug.cgi?id=90229
> [2] git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
> 
> 
> -- 
> Jani Nikula, Intel Open Source Technology Center
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [for-next] NULL pointer dereference in codec probe
  2015-04-30 10:23 ` Takashi Iwai
@ 2015-04-30 11:07   ` Jie, Yang
  2015-04-30 12:27   ` Jie, Yang
  1 sibling, 0 replies; 6+ messages in thread
From: Jie, Yang @ 2015-04-30 11:07 UTC (permalink / raw)
  To: Takashi Iwai, Nikula, Jani; +Cc: alsa-devel@alsa-project.org, Tian, YeX

> -----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. 

~Keyon

> 
> 
> thanks,
> 
> Takashi
> 
> 
> >
> > BR,
> > Jani.
> >
> >
> > [1] https://bugs.freedesktop.org/show_bug.cgi?id=90229
> > [2] git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
> >
> >
> > --
> > Jani Nikula, Intel Open Source Technology Center
> >

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [for-next] NULL pointer dereference in codec probe
  2015-04-30 10:23 ` Takashi Iwai
  2015-04-30 11:07   ` Jie, Yang
@ 2015-04-30 12:27   ` Jie, Yang
  2015-04-30 13:31     ` Takashi Iwai
  1 sibling, 1 reply; 6+ messages in thread
From: Jie, Yang @ 2015-04-30 12:27 UTC (permalink / raw)
  To: Takashi Iwai, Nikula, Jani; +Cc: alsa-devel@alsa-project.org, Tian, YeX

> -----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

~Keyon
> 
> ~Keyon
> 
> >
> >
> > thanks,
> >
> > Takashi
> >
> >
> > >
> > > BR,
> > > Jani.
> > >
> > >
> > > [1] https://bugs.freedesktop.org/show_bug.cgi?id=90229
> > > [2] git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
> > >
> > >
> > > --
> > > Jani Nikula, Intel Open Source Technology Center
> > >

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [for-next] NULL pointer dereference in codec probe
  2015-04-30 12:27   ` Jie, Yang
@ 2015-04-30 13:31     ` Takashi Iwai
  2015-04-30 13:53       ` Jie, Yang
  0 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2015-04-30 13:31 UTC (permalink / raw)
  To: Jie, Yang; +Cc: Nikula, Jani, alsa-devel@alsa-project.org, Tian, YeX

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 <tiwai@suse.de>
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 <tiwai@suse.de>
---
 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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [for-next] NULL pointer dereference in codec probe
  2015-04-30 13:31     ` Takashi Iwai
@ 2015-04-30 13:53       ` Jie, Yang
  0 siblings, 0 replies; 6+ messages in thread
From: Jie, Yang @ 2015-04-30 13:53 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Nikula, Jani, alsa-devel@alsa-project.org, Tian, YeX

> -----Original Message-----
> From: Takashi Iwai [mailto:tiwai@suse.de]
> Sent: Thursday, April 30, 2015 9:32 PM
> To: Jie, Yang
> Cc: Nikula, Jani; Jaroslav Kysela; alsa-devel@alsa-project.org; Tian, YeX
> Subject: Re: [for-next] NULL pointer dereference in codec probe
> 
> 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.
 
Cool! Thank you Takashi! Then I don't need go to work on May Day.
I can try those patches next Monday.

~Keyon

> 
> 
> thanks,
> 
> Takashi
> 
> -- 8< --
> From: Takashi Iwai <tiwai@suse.de>
> 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 <tiwai@suse.de>
> ---
>  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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-04-30 13:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-30 10:06 [for-next] NULL pointer dereference in codec probe Jani Nikula
2015-04-30 10:23 ` Takashi Iwai
2015-04-30 11:07   ` Jie, Yang
2015-04-30 12:27   ` Jie, Yang
2015-04-30 13:31     ` Takashi Iwai
2015-04-30 13:53       ` Jie, Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox