Josh Boyer af1af57
--- a/drivers/scsi/sd.c	
Josh Boyer af1af57
+++ a/drivers/scsi/sd.c	
Josh Boyer af1af57
@@ -2362,13 +2362,18 @@ static int sd_try_extended_inquiry(struct scsi_device *sdp)
Josh Boyer af1af57
 static int sd_revalidate_disk(struct gendisk *disk)
Josh Boyer af1af57
 {
Josh Boyer af1af57
 	struct scsi_disk *sdkp = scsi_disk(disk);
Josh Boyer af1af57
-	struct scsi_device *sdp = sdkp->device;
Josh Boyer af1af57
+	struct scsi_device *sdp;
Josh Boyer af1af57
 	unsigned char *buffer;
Josh Boyer af1af57
 	unsigned flush = 0;
Josh Boyer af1af57
 
Josh Boyer af1af57
 	SCSI_LOG_HLQUEUE(3, sd_printk(KERN_INFO, sdkp,
Josh Boyer af1af57
 				      "sd_revalidate_disk\n"));
Josh Boyer af1af57
 
Josh Boyer 7505efc
+	if (WARN_ONCE((!sdkp), "Invalid scsi_disk from %p\n", disk))
Josh Boyer af1af57
+		goto out;
Josh Boyer af1af57
+
Josh Boyer af1af57
+	sdp = sdkp->device;
Josh Boyer af1af57
+
Josh Boyer af1af57
 	/*
Josh Boyer af1af57
 	 * If the device is offline, don't try and read capacity or any
Josh Boyer af1af57
 	 * of the other niceties.