diff mbox series

RDMA/hns: Fix an error code in hns_roce_create_srq()

Message ID 20181217070815.GF12159@kadam (mailing list archive)
State Accepted
Commit e9dfa53a399545056cf97cf8c996d71dcebb4d7e
Delegated to: Jason Gunthorpe
Headers show
Series RDMA/hns: Fix an error code in hns_roce_create_srq() | expand

Commit Message

Dan Carpenter Dec. 17, 2018, 7:08 a.m. UTC
The function accidentally returns success on this error path.

Fixes: c7bcb13442e1 ("RDMA/hns: Add SRQ support for hip08 kernel mode")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/infiniband/hw/hns/hns_roce_srq.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Lijun Ou Dec. 17, 2018, 11:18 a.m. UTC | #1
在 2018/12/17 15:08, Dan Carpenter 写道:
> The function accidentally returns success on this error path.
>
> Fixes: c7bcb13442e1 ("RDMA/hns: Add SRQ support for hip08 kernel mode")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/infiniband/hw/hns/hns_roce_srq.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/infiniband/hw/hns/hns_roce_srq.c b/drivers/infiniband/hw/hns/hns_roce_srq.c
> index 463df60094e8..6377e734e28e 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_srq.c
> +++ b/drivers/infiniband/hw/hns/hns_roce_srq.c
> @@ -286,6 +286,7 @@ struct ib_srq *hns_roce_create_srq(struct ib_pd *pd,
>  		if (IS_ERR(srq->idx_que.umem)) {
>  			dev_err(hr_dev->dev,
>  				"ib_umem_get error for index queue\n");
> +			ret = PTR_ERR(srq->idx_que.umem);
>  			goto err_srq_mtt;
>  		}
>  

Ok,thanks
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/hns/hns_roce_srq.c b/drivers/infiniband/hw/hns/hns_roce_srq.c
index 463df60094e8..6377e734e28e 100644
--- a/drivers/infiniband/hw/hns/hns_roce_srq.c
+++ b/drivers/infiniband/hw/hns/hns_roce_srq.c
@@ -286,6 +286,7 @@  struct ib_srq *hns_roce_create_srq(struct ib_pd *pd,
 		if (IS_ERR(srq->idx_que.umem)) {
 			dev_err(hr_dev->dev,
 				"ib_umem_get error for index queue\n");
+			ret = PTR_ERR(srq->idx_que.umem);
 			goto err_srq_mtt;
 		}