All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
To: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
Cc: i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
Subject: Re: class_for_each_device() oops
Date: Wed, 23 Jul 2008 16:18:59 -0700	[thread overview]
Message-ID: <20080723231859.GB30234@kroah.com> (raw)
In-Reply-To: <200807231606.48016.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>

On Wed, Jul 23, 2008 at 04:06:47PM -0700, David Brownell wrote:
> I happened across this ... it looks like the root cause
> is that an i2c driver ("smbus_alert") gets registered
> before the class ("i2c_adapter") being iterated.
> 
> (This used the latest version of the patch adding SMBus
> alert support to I2C.  It's not mainline, although it's
> been posted a few times.)
> 
> 
> Now, obviously a trivial fix is to change that init order,
> and just accept that there's now an init dependency which
> didn't exist before.  But on the other hand I don't think
> that it's reasonable to oops there; it's needless, and in
> fact it never oopsed before!  
> 
> In this case adding 
> 
> 	if (!class->p)
> 		return -EINVAL;
> 
> at the top of class_for_each_device() would prevent such
> oopses from ever happening.

Makes sense, care to send a real patch for this?

thanks,

greg k-h

_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

  parent reply	other threads:[~2008-07-23 23:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-23 23:06 class_for_each_device() oops David Brownell
     [not found] ` <200807231606.48016.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-07-23 23:18   ` Greg KH [this message]
     [not found]     ` <20080723231859.GB30234-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2008-07-23 23:43       ` David Brownell

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=20080723231859.GB30234@kroah.com \
    --to=greg-u8xffu+wg4eavxtiumwx3w@public.gmane.org \
    --cc=david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org \
    --cc=i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org \
    /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.