Skip to content

Commit

Permalink
IB/uverbs: Free uapi on destroy
Browse files Browse the repository at this point in the history
Make sure we free struct uverbs_api once we clean the radix tree. It was
allocated by uverbs_alloc_api().

Fixes: 9ed3e5f ("IB/uverbs: Build the specs into a radix tree at runtime")
Reported-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
  • Loading branch information
Mark Bloch authored and Jason Gunthorpe committed Sep 25, 2018
1 parent de5c95d commit a9360ab
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/infiniband/core/uverbs_uapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ void uverbs_destroy_api(struct uverbs_api *uapi)
kfree(rcu_dereference_protected(*slot, true));
radix_tree_iter_delete(&uapi->radix, &iter, slot);
}
kfree(uapi);
}

struct uverbs_api *uverbs_alloc_api(
Expand Down

0 comments on commit a9360ab

Please sign in to comment.