Thread (56 messages) 56 messages, 2 authors, 2021-07-15
STALE1805d

[PATCH AUTOSEL 4.19 20/55] RDMA/cxgb4: Fix missing error code in create_qp()

From: Sasha Levin <sashal@kernel.org>
Date: 2021-07-06 12:02:37
Also in: linux-rdma, lkml
Subsystem: cxgb4 iwarp rnic driver (iw_cxgb4), infiniband subsystem, the rest · Maintainers: Potnuri Bharat Teja, Jason Gunthorpe, Leon Romanovsky, Linus Torvalds

From: Jiapeng Chong <redacted>

[ Upstream commit aeb27bb76ad8197eb47890b1ff470d5faf8ec9a5 ]

The error code is missing in this code scenario so 0 will be returned. Add
the error code '-EINVAL' to the return value 'ret'.

Eliminates the follow smatch warning:

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

Link: https://lore.kernel.org/r/1622545669-20625-1-git-send-email-jiapeng.chong@linux.alibaba.com (local)
Reported-by: Abaci Robot <redacted>
Signed-off-by: Jiapeng Chong <redacted>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/infiniband/hw/cxgb4/qp.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
index caa6a502c37e..20e3128f59b1 100644
--- a/drivers/infiniband/hw/cxgb4/qp.c
+++ b/drivers/infiniband/hw/cxgb4/qp.c
@@ -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;
 	}
 
-- 
2.30.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help