PATCH: Check return code from scsi_sysfs_add_sdev

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



James:

This patch (as541) 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.

Alan Stern



Signed-off-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>

Index: 2.6.13-rc2/drivers/scsi/scsi_scan.c
===================================================================
--- 2.6.13-rc2.orig/drivers/scsi/scsi_scan.c
+++ 2.6.13-rc2/drivers/scsi/scsi_scan.c
@@ -756,7 +756,8 @@ static int scsi_add_lun(struct scsi_devi
 	 * 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;
 }

-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux