RDMA/hns: Fix error return code in hns_roce_v1_rsv_lp_qp()
Subsystems (3)
PATCH 1/1 RDMA/hns: Fix error return code in hns_roce_v1_rsv_lp_qp()
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 <[email protected]>
--- drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/infiniband/hw/hns/hns_roce_hw_v1.c +3 -1
@@ -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 );
Quoted 10 lines · Wei Yongjun
Fix to return error code
-ENOMEMfrom therdma_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 <[email protected]>--- drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Thanks,
Reviewed-by Leon Romanovsky <[email protected]>
Doug Ledford
AppliedQuoted 6 lines · Wei Yongjun
Fix to return error code
-ENOMEMfrom therdma_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 <[email protected]>
Thanks, applied to for-rc.
Signature · 3 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD