public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: remove superfluous NULL pointer check from scsi_kill_request()
@ 2009-07-26 14:29 Bartlomiej Zolnierkiewicz
  2009-07-25 15:42 ` Joe Perches
  0 siblings, 1 reply; 3+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-07-26 14:29 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-kernel, linux-scsi, Dan Carpenter, corbet, eteo

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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-07-26 14:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-26 14:29 [PATCH] scsi: remove superfluous NULL pointer check from scsi_kill_request() Bartlomiej Zolnierkiewicz
2009-07-25 15:42 ` Joe Perches
2009-07-25 15:54   ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox