From: James Bottomley Date: Mon, 16 Oct 2006 15:57:05 +0000 (-0500) Subject: [SCSI] libsas: better error handling in sas_ex_discover_end_dev() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=528fd55200ec135548e71aee43650bca92a041aa;p=mv-sheeva.git [SCSI] libsas: better error handling in sas_ex_discover_end_dev() 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 --- diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index 07464873ab8..d05fc23b4d5 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c @@ -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);