public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] [SCSI] scsi_dh: potential null dereference in
@ 2011-01-03  5:48 Dan Carpenter
  2011-01-04 16:13 ` Moger, Babu
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2011-01-03  5:48 UTC (permalink / raw)
  To: James E.J. Bottomley
  Cc: Mike Snitzer, Menny Hamburger, Babu Moger, linux-scsi,
	kernel-janitors

We assumed "sdev" could be NULL ealier, so lets check it here as well.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/scsi/device_handler/scsi_dh.c b/drivers/scsi/device_handler/scsi_dh.c
index b837c5b..ff340e3 100644
--- a/drivers/scsi/device_handler/scsi_dh.c
+++ b/drivers/scsi/device_handler/scsi_dh.c
@@ -446,7 +446,7 @@ int scsi_dh_activate(struct request_queue *q, activate_complete fn, void *data)
 	    sdev->sdev_state = SDEV_CANCEL ||
 	    sdev->sdev_state = SDEV_DEL)
 		err = SCSI_DH_NOSYS;
-	if (sdev->sdev_state = SDEV_OFFLINE)
+	if (sdev && sdev->sdev_state = SDEV_OFFLINE)
 		err = SCSI_DH_DEV_OFFLINED;
 	spin_unlock_irqrestore(q->queue_lock, flags);
 

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

end of thread, other threads:[~2011-01-04 19:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-03  5:48 [patch] [SCSI] scsi_dh: potential null dereference in Dan Carpenter
2011-01-04 16:13 ` Moger, Babu
2011-01-04 16:24   ` James Bottomley
2011-01-04 19:50     ` Moger, Babu
2011-01-04 19:58       ` James Bottomley

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