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