IB/core: A small refactor in destroy WQ handler
authorMatan Barak <matanb@mellanox.com>
Tue, 18 Apr 2017 09:03:40 +0000 (12:03 +0300)
committerDoug Ledford <dledford@redhat.com>
Thu, 20 Apr 2017 15:44:07 +0000 (11:44 -0400)
Instead of having uverbs_uobject_put both in the error flow and the
good flow, we unite them.

Fixes: fd3c7904db6e ('IB/core: Change idr objects to use the new schema')
Signed-off-by: Matan Barak <matanb@mellanox.com>
Reviewed-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/uverbs_cmd.c

index b9024fa31b18559a0524230ac6dfde0302c10cf5..66cb22e82e2418f6a85b350424d36ceb450d7f58 100644 (file)
@@ -2989,18 +2989,12 @@ int ib_uverbs_ex_destroy_wq(struct ib_uverbs_file *file,
        uverbs_uobject_get(uobj);
 
        ret = uobj_remove_commit(uobj);
-       if (ret) {
-               uverbs_uobject_put(uobj);
-               return ret;
-       }
-
        resp.events_reported = obj->uevent.events_reported;
        uverbs_uobject_put(uobj);
-       ret = ib_copy_to_udata(ucore, &resp, resp.response_length);
        if (ret)
                return ret;
 
-       return 0;
+       return ib_copy_to_udata(ucore, &resp, resp.response_length);
 }
 
 int ib_uverbs_ex_modify_wq(struct ib_uverbs_file *file,