]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
RDMA/cxgb4: Fix missing error code in create_qp()
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Tue, 1 Jun 2021 11:07:49 +0000 (19:07 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 13 Aug 2021 07:46:35 +0000 (09:46 +0200)
BugLink: https://bugs.launchpad.net/bugs/1938713
[ 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
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/infiniband/hw/cxgb4/qp.c

index e7472f0da59d2b2c3ef69720306d64f179b48fee..3ac08f47a8ce47b79cd0e42e15da765af6363879 100644 (file)
@@ -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;
        }