RDMA/uverbs: Pass udata on uverbs error unwind

When destroy_* is called as a result of uverbs create cleanup flow a
cleared udata should be passed instead of NULL to indicate that it is
called under user flow.

Fixes: c4367a2635 ("IB: Pass uverbs_attr_bundle down ib_x destroy path")
Signed-off-by: Gal Pressman <galpress@amazon.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
Gal Pressman
2019-05-22 11:06:43 +03:00
committed by Jason Gunthorpe
parent 6875cb175c
commit 6876aaedc8
2 changed files with 6 additions and 5 deletions

View File

@@ -1053,7 +1053,7 @@ static struct ib_ucq_object *create_cq(struct uverbs_attr_bundle *attrs,
return obj; return obj;
err_cb: err_cb:
ib_destroy_cq(cq); ib_destroy_cq_user(cq, uverbs_get_cleared_udata(attrs));
err_file: err_file:
if (ev_file) if (ev_file)
@@ -1489,7 +1489,7 @@ static int create_qp(struct uverbs_attr_bundle *attrs,
return uobj_alloc_commit(&obj->uevent.uobject, attrs); return uobj_alloc_commit(&obj->uevent.uobject, attrs);
err_cb: err_cb:
ib_destroy_qp(qp); ib_destroy_qp_user(qp, uverbs_get_cleared_udata(attrs));
err_put: err_put:
if (!IS_ERR(xrcd_uobj)) if (!IS_ERR(xrcd_uobj))
@@ -1622,7 +1622,7 @@ static int ib_uverbs_open_qp(struct uverbs_attr_bundle *attrs)
return uobj_alloc_commit(&obj->uevent.uobject, attrs); return uobj_alloc_commit(&obj->uevent.uobject, attrs);
err_destroy: err_destroy:
ib_destroy_qp(qp); ib_destroy_qp_user(qp, uverbs_get_cleared_udata(attrs));
err_xrcd: err_xrcd:
uobj_put_read(xrcd_uobj); uobj_put_read(xrcd_uobj);
err_put: err_put:
@@ -2464,7 +2464,8 @@ static int ib_uverbs_create_ah(struct uverbs_attr_bundle *attrs)
return uobj_alloc_commit(uobj, attrs); return uobj_alloc_commit(uobj, attrs);
err_copy: err_copy:
rdma_destroy_ah(ah, RDMA_DESTROY_AH_SLEEPABLE); rdma_destroy_ah_user(ah, RDMA_DESTROY_AH_SLEEPABLE,
uverbs_get_cleared_udata(attrs));
err_put: err_put:
uobj_put_obj_read(pd); uobj_put_obj_read(pd);

View File

@@ -135,7 +135,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_CQ_CREATE)(
return 0; return 0;
err_cq: err_cq:
ib_destroy_cq(cq); ib_destroy_cq_user(cq, uverbs_get_cleared_udata(attrs));
err_event_file: err_event_file:
if (ev_file) if (ev_file)