diff mbox series

[for-rc,2/8] RDMA/hns: Bugfix for exception of creating srq

Message ID 1548405030-124329-3-git-send-email-oulijun@huawei.com (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show
Series Some hns bugfixes for 5.0-rc3 | expand

Commit Message

Lijun Ou Jan. 25, 2019, 8:30 a.m. UTC
It needs to copy the driver data to the user when creating srq.
if copy fail, it need to free the srq resource that have allocated
by hns_roce_srq_alloc function.

This patch depends on the patch("[PATCH V3 for-next] RDMA/hns: Update the kernel header file of hns")

Signed-off-by: Lijun Ou <oulijun@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_srq.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Dennis Dalessandro Jan. 25, 2019, 12:34 p.m. UTC | #1
On 1/25/2019 3:30 AM, Lijun Ou wrote:
> It needs to copy the driver data to the user when creating srq.
> if copy fail, it need to free the srq resource that have allocated
> by hns_roce_srq_alloc function.
> 
> This patch depends on the patch("[PATCH V3 for-next] RDMA/hns: Update the kernel header file of hns")

Should this just be squashed with that fix then? I don't think it was 
pushed to Linus. Or is it set in stone, in which case you should have an 
actual SHA to use here. I guess that's more of a question for Jason really.

-Denny
Jason Gunthorpe Jan. 25, 2019, 4:56 p.m. UTC | #2
On Fri, Jan 25, 2019 at 07:34:31AM -0500, Dennis Dalessandro wrote:
> On 1/25/2019 3:30 AM, Lijun Ou wrote:
> > It needs to copy the driver data to the user when creating srq.
> > if copy fail, it need to free the srq resource that have allocated
> > by hns_roce_srq_alloc function.
> > 
> > This patch depends on the patch("[PATCH V3 for-next] RDMA/hns: Update the kernel header file of hns")
> 
> Should this just be squashed with that fix then? I don't think it was pushed
> to Linus. Or is it set in stone, in which case you should have an actual SHA
> to use here. I guess that's more of a question for Jason really.

There was still time, I squahed it

Jason
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 a934511..12deacf 100644
--- a/drivers/infiniband/hw/hns/hns_roce_srq.c
+++ b/drivers/infiniband/hw/hns/hns_roce_srq.c
@@ -385,12 +385,15 @@  struct ib_srq *hns_roce_create_srq(struct ib_pd *pd,
 		if (ib_copy_to_udata(udata, &resp,
 				     min(udata->outlen, sizeof(resp)))) {
 			ret = -EFAULT;
-			goto err_wrid;
+			goto err_srqc_alloc;
 		}
 	}
 
 	return &srq->ibsrq;
 
+err_srqc_alloc:
+	hns_roce_srq_free(hr_dev, srq);
+
 err_wrid:
 	kvfree(srq->wrid);