All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Andrew Morton <akpm@osdl.org>
Cc: eric@buddington.net, Eric Buddington <ebuddington@verizon.net>,
	linux-kernel@vger.kernel.org,
	Kay Sievers <kay.sievers@novell.com>,
	Jaroslav Kysela <perex@suse.cz>, Takashi Iwai <tiwai@suse.de>
Subject: Re: 2.6.19-rc4-mm2: BUG modprobeing sound driver
Date: Mon, 13 Nov 2006 15:03:00 -0800	[thread overview]
Message-ID: <20061113230300.GA16571@kroah.com> (raw)
In-Reply-To: <20061109222829.fe9de523.akpm@osdl.org>

On Thu, Nov 09, 2006 at 10:28:29PM -0800, Andrew Morton wrote:
> On Thu, 9 Nov 2006 22:05:15 -0800
> Andrew Morton <akpm@osdl.org> wrote:
> 
> > Yup, trivial to reproduce: modprobe snd_serial_u16550 -> splat.
> > 
> > Bisection indicates that this oops is triggered by
> > gregkh-driver-sound-device.patch.
> > 
> > snd_serial_probe() never got to call snd_card_register(), so card->dev is
> > NULL.
> > 
> > snd_serial_probe() calls snd_card_free(card) on the error path and
> > snd_card_do_free() does device_del(card->dev) which oopses over the null
> > pointer it got.  
> 
> I suppose doing this is legit:
> 
> diff -puN sound/core/init.c~fix-gregkh-driver-sound-device sound/core/init.c
> --- a/sound/core/init.c~fix-gregkh-driver-sound-device
> +++ a/sound/core/init.c
> @@ -361,7 +361,8 @@ static int snd_card_do_free(struct snd_c
>  		snd_printk(KERN_WARNING "unable to free card info\n");
>  		/* Not fatal error */
>  	}
> -	device_unregister(card->dev);
> +	if (card->dev)
> +		device_unregister(card->dev);
>  	kfree(card);
>  	return 0;
>  }

Good idea, I've made that change now to the sound code.

thanks,

greg k-h

      reply	other threads:[~2006-11-13 23:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-09 14:22 2.6.19-rc4-mm2: BUG modprobeing sound driver Eric Buddington
2006-11-10  6:05 ` Andrew Morton
2006-11-10  6:28   ` Andrew Morton
2006-11-13 23:03     ` Greg KH [this message]

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=20061113230300.GA16571@kroah.com \
    --to=greg@kroah.com \
    --cc=akpm@osdl.org \
    --cc=ebuddington@verizon.net \
    --cc=eric@buddington.net \
    --cc=kay.sievers@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@suse.cz \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.