mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: James.Bottomley@hansenpartnership.com,
	linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
	Dan Carpenter <error27@gmail.com>,
	corbet@lwn.net, eteo@redhat.com
Subject: Re: [PATCH] scsi: remove superfluous NULL pointer check from scsi_kill_request()
Date: Sat, 25 Jul 2009 08:42:18 -0700	[thread overview]
Message-ID: <1248536538.20477.2.camel@Joe-Laptop.home> (raw)
In-Reply-To: <200907261629.26529.bzolnier@gmail.com>

On Sun, 2009-07-26 at 16:29 +0200, Bartlomiej Zolnierkiewicz wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] scsi: remove superfluous NULL pointer check from scsi_kill_request()
> 
> >From Dan's list:
> 
> drivers/scsi/scsi_lib.c +1365 scsi_kill_request(9) warning: variable derefenced in initializer 'cmd'
> drivers/scsi/scsi_lib.c +1365 scsi_kill_request(9) warning: variable derefenced before check 'cmd'
> 
> We dereference cmd (and possible OOPS if cmd == NULL) before starting
> the request so just remove the superfluous debugging code altogether.
> 
> Reported-by: Dan Carpenter <error27@gmail.com>
> Cc: corbet@lwn.net
> Cc: eteo@redhat.com
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> ---
>  drivers/scsi/scsi_lib.c |    6 ------
>  1 file changed, 6 deletions(-)
> 
> Index: b/drivers/scsi/scsi_lib.c
> ===================================================================
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -1365,12 +1365,6 @@ static void scsi_kill_request(struct req
>  
>  	blk_start_request(req);
>  
> -	if (unlikely(cmd == NULL)) {
> -		printk(KERN_CRIT "impossible request in %s.\n",
> -				 __func__);
> -		BUG();
> -	}
> -
>  	scsi_init_cmd_errh(cmd);
>  	cmd->result = DID_NO_CONNECT << 16;
>  	atomic_inc(&cmd->device->iorequest_cnt);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



  reply	other threads:[~2009-07-25 15:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-26 14:29 Bartlomiej Zolnierkiewicz
2009-07-25 15:42 ` Joe Perches [this message]
2009-07-25 15:54   ` Joe Perches

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=1248536538.20477.2.camel@Joe-Laptop.home \
    --to=joe@perches.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=bzolnier@gmail.com \
    --cc=corbet@lwn.net \
    --cc=error27@gmail.com \
    --cc=eteo@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@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

all inboxes | Powered by JetHome®