소스 검색

[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 19 년 전
부모
커밋
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);