]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
RDMA/uverbs: Pass udata on uverbs error unwind
authorGal Pressman <galpress@amazon.com>
Wed, 22 May 2019 08:06:43 +0000 (11:06 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 27 May 2019 17:36:36 +0000 (14:36 -0300)
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: c4367a26357b ("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>
drivers/infiniband/core/uverbs_cmd.c
drivers/infiniband/core/uverbs_std_types_cq.c

index a9b32ebb9beb77288153ea70905e93e1d8e63fe5..63fe14c7c68fc31586fad4cd3559a52d03d62ea0 100644 (file)
@@ -1053,7 +1053,7 @@ static struct ib_ucq_object *create_cq(struct uverbs_attr_bundle *attrs,
        return obj;
 
 err_cb:
-       ib_destroy_cq(cq);
+       ib_destroy_cq_user(cq, uverbs_get_cleared_udata(attrs));
 
 err_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);
 err_cb:
-       ib_destroy_qp(qp);
+       ib_destroy_qp_user(qp, uverbs_get_cleared_udata(attrs));
 
 err_put:
        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);
 
 err_destroy:
-       ib_destroy_qp(qp);
+       ib_destroy_qp_user(qp, uverbs_get_cleared_udata(attrs));
 err_xrcd:
        uobj_put_read(xrcd_uobj);
 err_put:
@@ -2464,7 +2464,8 @@ static int ib_uverbs_create_ah(struct uverbs_attr_bundle *attrs)
        return uobj_alloc_commit(uobj, attrs);
 
 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:
        uobj_put_obj_read(pd);
index db5c46a1bb2ded538621689a249bd6822fcc9068..07ea4e3c45663a5fef7d889e986ddd3918a0efe4 100644 (file)
@@ -135,7 +135,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_CQ_CREATE)(
 
        return 0;
 err_cq:
-       ib_destroy_cq(cq);
+       ib_destroy_cq_user(cq, uverbs_get_cleared_udata(attrs));
 
 err_event_file:
        if (ev_file)