From: Leon Romanovsky Date: Wed, 13 Feb 2019 17:07:05 +0000 (+0200) Subject: RDMA/uverbs: Don't do double free of allocated PD X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=bb618451544ca9152a1a213d0a2b93d231c4cce1;p=linux.git RDMA/uverbs: Don't do double free of allocated PD There is no need to call kfree(pd) because ib_dealloc_pd() internally frees PD. Fixes: 21a428a019c9 ("RDMA: Handle PD allocations by IB/core") Reported-by: Dan Carpenter Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe --- diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 3128821ca36eb..062a86c041235 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -440,6 +440,7 @@ static int ib_uverbs_alloc_pd(struct uverbs_attr_bundle *attrs) err_copy: ib_dealloc_pd(pd); + pd = NULL; err_alloc: kfree(pd); err: