Skip to content

Commit 0629b40

Browse files
Wei Yongjungregkh
authored andcommitted
iser-target: fix error return code in isert_create_device_ib_res()
commit 94a7111 upstream. 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> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2b25925 commit 0629b40

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

‎drivers/infiniband/ulp/isert/ib_isert.c‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,21 +242,29 @@ isert_create_device_ib_res(struct isert_device *device)
242242
isert_cq_event_callback,
243243
(void *)&cq_desc[i],
244244
ISER_MAX_RX_CQ_LEN, i);
245-
if (IS_ERR(device->dev_rx_cq[i]))
245+
if (IS_ERR(device->dev_rx_cq[i])) {
246+
ret = PTR_ERR(device->dev_rx_cq[i]);
247+
device->dev_rx_cq[i] = NULL;
246248
goto out_cq;
249+
}
247250

248251
device->dev_tx_cq[i] = ib_create_cq(device->ib_device,
249252
isert_cq_tx_callback,
250253
isert_cq_event_callback,
251254
(void *)&cq_desc[i],
252255
ISER_MAX_TX_CQ_LEN, i);
253-
if (IS_ERR(device->dev_tx_cq[i]))
256+
if (IS_ERR(device->dev_tx_cq[i])) {
257+
ret = PTR_ERR(device->dev_tx_cq[i]);
258+
device->dev_tx_cq[i] = NULL;
254259
goto out_cq;
260+
}
255261

256-
if (ib_req_notify_cq(device->dev_rx_cq[i], IB_CQ_NEXT_COMP))
262+
ret = ib_req_notify_cq(device->dev_rx_cq[i], IB_CQ_NEXT_COMP);
263+
if (ret)
257264
goto out_cq;
258265

259-
if (ib_req_notify_cq(device->dev_tx_cq[i], IB_CQ_NEXT_COMP))
266+
ret = ib_req_notify_cq(device->dev_tx_cq[i], IB_CQ_NEXT_COMP);
267+
if (ret)
260268
goto out_cq;
261269
}
262270

0 commit comments

Comments
 (0)