]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/scsi_sysfs.c
[SCSI] fix intermittent oops in scsi_bus_uevent
[linux-2.6-omap-h63xx.git] / drivers / scsi / scsi_sysfs.c
index 049103f1d16ffd320ca51a5544aca1966dc71585..93d2b6714453e6ae7e11f1cd2e3b864182f7d66d 100644 (file)
@@ -359,7 +359,12 @@ static int scsi_bus_match(struct device *dev, struct device_driver *gendrv)
 
 static int scsi_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
 {
-       struct scsi_device *sdev = to_scsi_device(dev);
+       struct scsi_device *sdev;
+
+       if (dev->type != &scsi_dev_type)
+               return 0;
+
+       sdev = to_scsi_device(dev);
 
        add_uevent_var(env, "MODALIAS=" SCSI_DEVICE_MODALIAS_FMT, sdev->type);
        return 0;