aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2010-08-10 21:01:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-11 11:59:00 -0400
commitd6e9fb46cd9e60946dc3e89ad8e32dd251dcc05d (patch)
tree10660b30049be0d19fc57c880e06cd6d9f2a3ab7 /drivers/scsi
parent85bc081f44d53e3ac268c59275cc3b9b5afae04a (diff)
scsi: remove superfluous NULL pointer check from scsi_kill_request()
Dan's list included: 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. [ bart: the potential NULL pointer dereference was finally fixed in (much later than mine) commit 03b1470 but my patch is still valid ] Reported-by: Dan Carpenter <error27@gmail.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Eugene Teo <eteo@redhat.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/scsi_lib.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index b8de389636f8..9ade720422c6 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1370,12 +1370,6 @@ static void scsi_kill_request(struct request *req, struct request_queue *q)
1370 1370
1371 blk_start_request(req); 1371 blk_start_request(req);
1372 1372
1373 if (unlikely(cmd == NULL)) {
1374 printk(KERN_CRIT "impossible request in %s.\n",
1375 __func__);
1376 BUG();
1377 }
1378
1379 sdev = cmd->device; 1373 sdev = cmd->device;
1380 starget = scsi_target(sdev); 1374 starget = scsi_target(sdev);
1381 shost = sdev->host; 1375 shost = sdev->host;