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: 1550557717 ("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>
This commit is contained in:
Boshi Yu 2025-07-25 13:53:55 +08:00 committed by Leon Romanovsky
parent 3c3e9a9f29
commit d5c74713f0

View File

@ -1031,7 +1031,9 @@ int erdma_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *attrs,
if (ret)
goto err_out_cmd;
} else {
init_kernel_qp(dev, qp, attrs);
ret = init_kernel_qp(dev, qp, attrs);
if (ret)
goto err_out_xa;
}
qp->attrs.max_send_sge = attrs->cap.max_send_sge;