summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_scan.c
diff options
context:
space:
mode:
authorAlan Stern2005-07-27 20:43:46 +0200
committerLinus Torvalds2005-07-28 01:25:51 +0200
commitb24b1033451fcc87087a692fc47ca45daebd51ac (patch)
tree6a0bba28834105976dad411f37d98a494f6312b0 /drivers/scsi/scsi_scan.c
parent[PATCH] autofs4: fix infamous "Busy inodes after umount ..." message (diff)
downloadkernel-qcow2-linux-b24b1033451fcc87087a692fc47ca45daebd51ac.tar.gz
kernel-qcow2-linux-b24b1033451fcc87087a692fc47ca45daebd51ac.tar.xz
kernel-qcow2-linux-b24b1033451fcc87087a692fc47ca45daebd51ac.zip
[PATCH] scsi_scan: check return code from scsi_sysfs_add_sdev
Adds a missing check for an error return code from scsi_sysfs_add_sdev. This resolves entry #4863 in the OSDL bugzilla. Although in that bug report the failure occurred because of a confusion over scanning vs. rescanning, in general add_sdev can fail for a number of reasons (the simplest being insufficient memory) and the caller should cope properly. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: James Bottomley <James.Bottomley@SteelEye.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/scsi/scsi_scan.c')
-rw-r--r--drivers/scsi/scsi_scan.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index ad3a5b142468..2d3c4ac475f2 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -756,7 +756,8 @@ static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags)
* register it and tell the rest of the kernel
* about it.
*/
- scsi_sysfs_add_sdev(sdev);
+ if (scsi_sysfs_add_sdev(sdev) != 0)
+ return SCSI_SCAN_NO_RESPONSE;
return SCSI_SCAN_LUN_PRESENT;
}