All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RDMA/hns: Fix error return code in hns_roce_v1_rsv_lp_qp()
@ 2019-08-01  1:27 ` Wei Yongjun
  0 siblings, 0 replies; 6+ messages in thread
From: Wei Yongjun @ 2019-08-01  1:27 UTC (permalink / raw)
  To: Lijun Ou, Wei Hu(Xavier), Doug Ledford, Jason Gunthorpe, Colin Ian King
  Cc: Wei Yongjun, linux-rdma, kernel-janitors

Fix to return error code -ENOMEM from the rdma_zalloc_drv_obj() error
handling case instead of 0, as done elsewhere in this function.

Fixes: e8ac9389f0d7 ("RDMA: Fix allocation failure on pointer pd")
Fixes: 21a428a019c9 ("RDMA: Handle PD allocations by IB/core")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index 70583f82e290..aa8a660ffcda 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -750,8 +750,10 @@ static int hns_roce_v1_rsv_lp_qp(struct hns_roce_dev *hr_dev)
 	atomic_set(&free_mr->mr_free_cq->ib_cq.usecnt, 0);
 
 	pd = rdma_zalloc_drv_obj(ibdev, ib_pd);
-	if (!pd)
+	if (!pd) {
+		ret = -ENOMEM;
 		goto alloc_mem_failed;
+	}
 
 	pd->device  = ibdev;
 	ret = hns_roce_alloc_pd(pd, NULL);




^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] RDMA/hns: Fix error return code in hns_roce_v1_rsv_lp_qp()
@ 2019-08-01  1:27 ` Wei Yongjun
  0 siblings, 0 replies; 6+ messages in thread
From: Wei Yongjun @ 2019-08-01  1:27 UTC (permalink / raw)
  To: Lijun Ou, Wei Hu(Xavier), Doug Ledford, Jason Gunthorpe, Colin Ian King
  Cc: Wei Yongjun, linux-rdma, kernel-janitors

Fix to return error code -ENOMEM from the rdma_zalloc_drv_obj() error
handling case instead of 0, as done elsewhere in this function.

Fixes: e8ac9389f0d7 ("RDMA: Fix allocation failure on pointer pd")
Fixes: 21a428a019c9 ("RDMA: Handle PD allocations by IB/core")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index 70583f82e290..aa8a660ffcda 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -750,8 +750,10 @@ static int hns_roce_v1_rsv_lp_qp(struct hns_roce_dev *hr_dev)
 	atomic_set(&free_mr->mr_free_cq->ib_cq.usecnt, 0);
 
 	pd = rdma_zalloc_drv_obj(ibdev, ib_pd);
-	if (!pd)
+	if (!pd) {
+		ret = -ENOMEM;
 		goto alloc_mem_failed;
+	}
 
 	pd->device  = ibdev;
 	ret = hns_roce_alloc_pd(pd, NULL);

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] RDMA/hns: Fix error return code in hns_roce_v1_rsv_lp_qp()
  2019-08-01  1:27 ` Wei Yongjun
@ 2019-08-01  7:54   ` Leon Romanovsky
  -1 siblings, 0 replies; 6+ messages in thread
From: Leon Romanovsky @ 2019-08-01  7:54 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Lijun Ou, Wei Hu(Xavier),
	Doug Ledford, Jason Gunthorpe, Colin Ian King, linux-rdma,
	kernel-janitors

On Thu, Aug 01, 2019 at 01:27:25AM +0000, Wei Yongjun wrote:
> Fix to return error code -ENOMEM from the rdma_zalloc_drv_obj() error
> handling case instead of 0, as done elsewhere in this function.
>
> Fixes: e8ac9389f0d7 ("RDMA: Fix allocation failure on pointer pd")
> Fixes: 21a428a019c9 ("RDMA: Handle PD allocations by IB/core")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] RDMA/hns: Fix error return code in hns_roce_v1_rsv_lp_qp()
@ 2019-08-01  7:54   ` Leon Romanovsky
  0 siblings, 0 replies; 6+ messages in thread
From: Leon Romanovsky @ 2019-08-01  7:54 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Lijun Ou, Wei Hu(Xavier),
	Doug Ledford, Jason Gunthorpe, Colin Ian King, linux-rdma,
	kernel-janitors

On Thu, Aug 01, 2019 at 01:27:25AM +0000, Wei Yongjun wrote:
> Fix to return error code -ENOMEM from the rdma_zalloc_drv_obj() error
> handling case instead of 0, as done elsewhere in this function.
>
> Fixes: e8ac9389f0d7 ("RDMA: Fix allocation failure on pointer pd")
> Fixes: 21a428a019c9 ("RDMA: Handle PD allocations by IB/core")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] RDMA/hns: Fix error return code in hns_roce_v1_rsv_lp_qp()
  2019-08-01  1:27 ` Wei Yongjun
@ 2019-08-01 16:58   ` Doug Ledford
  -1 siblings, 0 replies; 6+ messages in thread
From: Doug Ledford @ 2019-08-01 16:58 UTC (permalink / raw)
  To: Wei Yongjun, Lijun Ou, Wei Hu(Xavier), Jason Gunthorpe, Colin Ian King
  Cc: linux-rdma, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 568 bytes --]

On Thu, 2019-08-01 at 01:27 +0000, Wei Yongjun wrote:
> Fix to return error code -ENOMEM from the rdma_zalloc_drv_obj() error
> handling case instead of 0, as done elsewhere in this function.
> 
> Fixes: e8ac9389f0d7 ("RDMA: Fix allocation failure on pointer pd")
> Fixes: 21a428a019c9 ("RDMA: Handle PD allocations by IB/core")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>


Thanks, applied to for-rc.

-- 
Doug Ledford <dledford@redhat.com>
    GPG KeyID: B826A3330E572FDD
    Fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] RDMA/hns: Fix error return code in hns_roce_v1_rsv_lp_qp()
@ 2019-08-01 16:58   ` Doug Ledford
  0 siblings, 0 replies; 6+ messages in thread
From: Doug Ledford @ 2019-08-01 16:58 UTC (permalink / raw)
  To: Wei Yongjun, Lijun Ou, Wei Hu(Xavier), Jason Gunthorpe, Colin Ian King
  Cc: linux-rdma, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 568 bytes --]

On Thu, 2019-08-01 at 01:27 +0000, Wei Yongjun wrote:
> Fix to return error code -ENOMEM from the rdma_zalloc_drv_obj() error
> handling case instead of 0, as done elsewhere in this function.
> 
> Fixes: e8ac9389f0d7 ("RDMA: Fix allocation failure on pointer pd")
> Fixes: 21a428a019c9 ("RDMA: Handle PD allocations by IB/core")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>


Thanks, applied to for-rc.

-- 
Doug Ledford <dledford@redhat.com>
    GPG KeyID: B826A3330E572FDD
    Fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-08-01 16:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-01  1:27 [PATCH] RDMA/hns: Fix error return code in hns_roce_v1_rsv_lp_qp() Wei Yongjun
2019-08-01  1:27 ` Wei Yongjun
2019-08-01  7:54 ` Leon Romanovsky
2019-08-01  7:54   ` Leon Romanovsky
2019-08-01 16:58 ` Doug Ledford
2019-08-01 16:58   ` Doug Ledford

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.