]> err.no Git - linux-2.6/commitdiff
[SCSI] libsas: better error handling in sas_ex_discover_end_dev()
authorJames Bottomley <James.Bottomley@steeleye.com>
Mon, 16 Oct 2006 15:57:05 +0000 (10:57 -0500)
committerJames Bottomley <jejb@mulgrave.localdomain>
Wed, 18 Jul 2007 16:14:25 +0000 (11:14 -0500)
This replaces a few BUG_ON() statements with the correct failure error
handling.  There are still many more to do.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/libsas/sas_expander.c

index 07464873ab89c0b01de02a8ee5024a40c7b16d93..d05fc23b4d5b9dd445357d5a793853e1081be9ed 100644 (file)
@@ -670,8 +670,8 @@ static struct domain_device *sas_ex_discover_end_dev(
                       sizeof(struct dev_to_host_fis));
 
                rphy = sas_end_device_alloc(phy->port);
-               /* FIXME: error handling */
-               BUG_ON(!rphy);
+               if (unlikely(!rphy))
+                       goto out_free;
 
                sas_init_dev(child);