Skip to content

Commit

Permalink
scsi: ignore errors from scsi_dh_add_device()
Browse files Browse the repository at this point in the history
commit 221255a upstream.

device handler initialisation might fail due to a number of
reasons. But as device_handlers are optional this shouldn't
cause us to disable the device entirely.
So just ignore errors from scsi_dh_add_device().

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
hreinecke authored and gregkh committed Aug 16, 2016
1 parent 694dfd0 commit 5a6f9d0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/scsi/scsi_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1058,11 +1058,12 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
}

error = scsi_dh_add_device(sdev);
if (error) {
if (error)
/*
* device_handler is optional, so any error can be ignored
*/
sdev_printk(KERN_INFO, sdev,
"failed to add device handler: %d\n", error);
return error;
}

device_enable_async_suspend(&sdev->sdev_dev);
error = device_add(&sdev->sdev_dev);
Expand Down

0 comments on commit 5a6f9d0

Please sign in to comment.