From: Matan Barak Date: Tue, 18 Apr 2017 09:03:40 +0000 (+0300) Subject: IB/core: A small refactor in destroy WQ handler X-Git-Tag: MMI-PSA29.97-13-9~5649^3~176^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c52d8114d1a58f6fe4bfb9af39d262dd8f21e50e;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git IB/core: A small refactor in destroy WQ handler 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 Reviewed-by: Sean Hefty Signed-off-by: Doug Ledford --- diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index b9024fa31b18..66cb22e82e24 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -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,