浏览代码

[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 <James.Bottomley@SteelEye.com>
James Bottomley 18 年之前
父节点
当前提交
528fd55200
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      drivers/scsi/libsas/sas_expander.c

+ 2 - 2
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);