Re: [PATCH] drivers: fix the exception was not returned

From: Leon Romanovsky
Date: Tue Sep 16 2025 - 09:49:42 EST


On Tue, Sep 16, 2025 at 05:11:54PM +0800, YanLong Dai wrote:
> From: daiyanlong <daiyanlong@xxxxxxxxxx>
>
> The return value rc of bnxt_qplib_destroy_qp is abnormal and no return

And what is wrong with that? This is expected behavior - do not fail if
destroy fails.

Thanks

>
> Signed-off-by: daiyanlong <daiyanlong@xxxxxxxxxx>
> ---
> drivers/infiniband/hw/bnxt_re/ib_verbs.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> index 260dc67b8b87..d52cfb50b1b8 100644
> --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> @@ -971,8 +971,10 @@ int bnxt_re_destroy_qp(struct ib_qp *ib_qp, struct ib_udata *udata)
> bnxt_qplib_flush_cqn_wq(&qp->qplib_qp);
>
> rc = bnxt_qplib_destroy_qp(&rdev->qplib_res, &qp->qplib_qp);
> - if (rc)
> + if (rc) {
> ibdev_err(&rdev->ibdev, "Failed to destroy HW QP");
> + return rc;
> + }
>
> if (rdma_is_kernel_res(&qp->ib_qp.res)) {
> flags = bnxt_re_lock_cqs(qp);
> --
> 2.43.0
>