From: David Brownell <david-b@pacbell.net>
To: stephen@streetfiresound.com
Cc: Russell King <rmk+lkml@arm.linux.org.uk>,
greg@kroah.com, linux-kernel@vger.kernel.org, dvrabel@arcom.com
Subject: Re: [PATCH] spi: Fix modular master driver remove and device suspend/remove
Date: Tue, 7 Feb 2006 13:56:29 -0800 [thread overview]
Message-ID: <200602071356.30045.david-b@pacbell.net> (raw)
In-Reply-To: <1139348125.4549.447.camel@localhost.localdomain>
On Tuesday 07 February 2006 1:35 pm, Stephen Street wrote:
> On Tue, 2006-02-07 at 08:03 +0000, Russell King wrote:
> > > @@ -90,7 +90,7 @@ static int spi_suspend(struct device *de
> > > int value;
> > > struct spi_driver *drv = to_spi_driver(dev->driver);
> > >
> > > - if (!drv->suspend)
> > > + if (!drv || !drv->suspend)
> >
> > Shouldn't this be dev->driver ? If dev->driver is NULL, drv may be
> > non-NULL due to an offset in the structure.
> >
> If I understand your comment correctly, the implementation of to_spi_drv
> protects against this by returning NULL if dev->driver is NULL. This is
> implementation dependent
I'd say that to_spi_driver() is defined that way, specifically
to avoid that class of nasty bug.
> and I can make the test explicit if you want?
>
prev parent reply other threads:[~2006-02-07 21:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-07 3:04 [PATCH] spi: Fix modular master driver remove and device suspend/remove stephen
2006-02-07 8:03 ` Russell King
2006-02-07 21:35 ` Stephen Street
2006-02-07 21:56 ` David Brownell [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=200602071356.30045.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=dvrabel@arcom.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk+lkml@arm.linux.org.uk \
--cc=stephen@streetfiresound.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox