···400400static void scsi_run_queue(struct request_queue *q)401401{402402 struct scsi_device *sdev = q->queuedata;403403- struct Scsi_Host *shost = sdev->host;403403+ struct Scsi_Host *shost;404404 LIST_HEAD(starved_list);405405 unsigned long flags;406406407407+ /* if the device is dead, sdev will be NULL, so no queue to run */408408+ if (!sdev)409409+ return;410410+411411+ shost = sdev->host;407412 if (scsi_target(sdev)->single_lun)408413 scsi_single_lun_run(sdev);409414