Skip to content

Commit d5c7471

Browse files
201608ybsrleon
authored andcommitted
RDMA/erdma: Fix ignored return value of init_kernel_qp
The init_kernel_qp interface may fail. Check its return value and free related resources properly when it does. Fixes: 1550557 ("RDMA/erdma: Add verbs implementation") Reviewed-by: Cheng Xu <chengyou@linux.alibaba.com> Signed-off-by: Boshi Yu <boshiyu@linux.alibaba.com> Link: https://patch.msgid.link/20250725055410.67520-3-boshiyu@linux.alibaba.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
1 parent 3c3e9a9 commit d5c7471

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/infiniband/hw/erdma/erdma_verbs.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,9 @@ int erdma_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *attrs,
10311031
if (ret)
10321032
goto err_out_cmd;
10331033
} else {
1034-
init_kernel_qp(dev, qp, attrs);
1034+
ret = init_kernel_qp(dev, qp, attrs);
1035+
if (ret)
1036+
goto err_out_xa;
10351037
}
10361038

10371039
qp->attrs.max_send_sge = attrs->cap.max_send_sge;

0 commit comments

Comments
 (0)