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