浏览代码

iser-target: fix error return code in isert_create_device_ib_res()

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Cc: <stable@vger.kernel.org> #3.10+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Wei Yongjun 11 年之前
父节点
当前提交
94a7111043
共有 1 个文件被更改,包括 12 次插入4 次删除
  1. 12 4
      drivers/infiniband/ulp/isert/ib_isert.c

+ 12 - 4
drivers/infiniband/ulp/isert/ib_isert.c

@@ -264,21 +264,29 @@ isert_create_device_ib_res(struct isert_device *device)
 						isert_cq_event_callback,
 						isert_cq_event_callback,
 						(void *)&cq_desc[i],
 						(void *)&cq_desc[i],
 						ISER_MAX_RX_CQ_LEN, i);
 						ISER_MAX_RX_CQ_LEN, i);
-		if (IS_ERR(device->dev_rx_cq[i]))
+		if (IS_ERR(device->dev_rx_cq[i])) {
+			ret = PTR_ERR(device->dev_rx_cq[i]);
+			device->dev_rx_cq[i] = NULL;
 			goto out_cq;
 			goto out_cq;
+		}
 
 
 		device->dev_tx_cq[i] = ib_create_cq(device->ib_device,
 		device->dev_tx_cq[i] = ib_create_cq(device->ib_device,
 						isert_cq_tx_callback,
 						isert_cq_tx_callback,
 						isert_cq_event_callback,
 						isert_cq_event_callback,
 						(void *)&cq_desc[i],
 						(void *)&cq_desc[i],
 						ISER_MAX_TX_CQ_LEN, i);
 						ISER_MAX_TX_CQ_LEN, i);
-		if (IS_ERR(device->dev_tx_cq[i]))
+		if (IS_ERR(device->dev_tx_cq[i])) {
+			ret = PTR_ERR(device->dev_tx_cq[i]);
+			device->dev_tx_cq[i] = NULL;
 			goto out_cq;
 			goto out_cq;
+		}
 
 
-		if (ib_req_notify_cq(device->dev_rx_cq[i], IB_CQ_NEXT_COMP))
+		ret = ib_req_notify_cq(device->dev_rx_cq[i], IB_CQ_NEXT_COMP);
+		if (ret)
 			goto out_cq;
 			goto out_cq;
 
 
-		if (ib_req_notify_cq(device->dev_tx_cq[i], IB_CQ_NEXT_COMP))
+		ret = ib_req_notify_cq(device->dev_tx_cq[i], IB_CQ_NEXT_COMP);
+		if (ret)
 			goto out_cq;
 			goto out_cq;
 	}
 	}