On 02/29/2016 08:55 PM, Hannes Reinecke wrote:
@@ -1241,6 +1234,13 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
                sdev_printk(KERN_INFO, sdev,
                                "failed to add device handler: %d\n", error);

+       error = device_add(&sdev->sdev_gendev);
+       if (error) {
+               sdev_printk(KERN_INFO, sdev,
+                               "failed to add device: %d\n", error);
+               return error;
+       }
+
        device_enable_async_suspend(&sdev->sdev_dev);
        error = device_add(&sdev->sdev_dev);
        if (error) {

Hello Hannes,

I think that scsi_dh_remove_device() should be called before returning if device_add() fails.

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to