Linux ATA/IDE development
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@suse.de>
To: Dan Carpenter <error27@gmail.com>
Cc: linux-ide@vger.kernel.org, davem@davemloft.net
Subject: Re: [patch] move dereference after null check
Date: Tue, 10 Nov 2009 09:19:50 -0500	[thread overview]
Message-ID: <1257862790.4184.203.camel@mulgrave.site> (raw)
In-Reply-To: <alpine.DEB.2.00.0911081949070.11108@bicker>

On Tue, 2009-11-10 at 10:55 +0200, Dan Carpenter wrote:
> I moved the ops->inherits dereference below the null check.  I moved the 
> other assignment as well so that they would be together.
> 
> Found by smatch static checker.
> 
> regards,
> dan carpenter
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> --- orig/drivers/ata/libata-core.c	2009-11-08 19:40:18.000000000 +0200
> +++ devel/drivers/ata/libata-core.c	2009-11-08 19:42:06.000000000 +0200
> @@ -5938,13 +5938,14 @@
>  {
>  	static DEFINE_SPINLOCK(lock);
>  	const struct ata_port_operations *cur;
> -	void **begin = (void **)ops;
> -	void **end = (void **)&ops->inherits;

There's no problem here: this isn't a dereference.

James


      reply	other threads:[~2009-11-10 14:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-10  8:55 [patch] move dereference after null check Dan Carpenter
2009-11-10 14:19 ` James Bottomley [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=1257862790.4184.203.camel@mulgrave.site \
    --to=james.bottomley@suse.de \
    --cc=davem@davemloft.net \
    --cc=error27@gmail.com \
    --cc=linux-ide@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox