public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Street <stephen@streetfiresound.com>
To: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: greg@kroah.com, linux-kernel@vger.kernel.org, dvrabel@arcom.com,
	David Brownell <david-b@pacbell.net>
Subject: Re: [PATCH] spi: Fix modular master driver remove and device suspend/remove
Date: Tue, 07 Feb 2006 13:35:25 -0800	[thread overview]
Message-ID: <1139348125.4549.447.camel@localhost.localdomain> (raw)
In-Reply-To: <20060207080351.GA3588@flint.arm.linux.org.uk>

On Tue, 2006-02-07 at 08:03 +0000, Russell King wrote:
> On Mon, Feb 06, 2006 at 07:04:11PM -0800, stephen@streetfiresound.com wrote:
> > --- linux-2.6.16-rc2/drivers/spi/spi.c	2006-02-06 18:39:31.746537258 -0800
> > +++ linux-spi/drivers/spi/spi.c	2006-02-06 18:39:45.353334421 -0800
> > @@ -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 and I can make the test explicit if you want?

-Stephen




  reply	other threads:[~2006-02-07 21:35 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 [this message]
2006-02-07 21:56     ` 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=1139348125.4549.447.camel@localhost.localdomain \
    --to=stephen@streetfiresound.com \
    --cc=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 \
    /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