Skip to contentSkip to conversation

RDMA/cxgb4: Fix missing error code in create_qp()

PATCH Applied Jiapeng Chong 2 participants 2 messages Jun 1, 2021 – Jun 4, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/cxgb4: Fix missing error code in create_qp()

The error code is missing in this code scenario, add the error code '-EINVAL' to the return value 'ret'.

Eliminate the follow smatch warning:

drivers/infiniband/hw/cxgb4/qp.c:298 create_qp() warn: missing error code 'ret'.

---
 drivers/infiniband/hw/cxgb4/qp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/infiniband/hw/cxgb4/qp.c +1 -0
index d109bb3..c940374 100644
@@ -295,6 +295,7 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4_wq *wq,
 	if (user && (!wq->sq.bar2_pa || (need_rq && !wq->rq.bar2_pa))) {
 		pr_warn("%s: sqid %u or rqid %u not in BAR2 range\n",
 			pci_name(rdev->lldi.pdev), wq->sq.qid, wq->rq.qid);
+		ret = -EINVAL;
 		goto free_dma;
 	}
 
Signature · 1 line
1.8.3.1
maintainer Applied
#1 lore raw
Quoted 5 lines · Jiapeng Chong

The error code is missing in this code scenario, add the error code '-EINVAL' to the return value 'ret'.

Eliminate the follow smatch warning:

Quoted 8 lines

drivers/infiniband/hw/cxgb4/qp.c:298 create_qp() warn: missing error code 'ret'.

---
 drivers/infiniband/hw/cxgb4/qp.c | 1 +
 1 file changed, 1 insertion(+)

Applied to for-next, thanks

Jason