summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@mellanox.com>2019-02-13 19:07:05 +0200
committerJason Gunthorpe <jgg@mellanox.com>2019-02-25 15:00:48 -0700
commitbb618451544ca9152a1a213d0a2b93d231c4cce1 (patch)
treec2ee489fcfdfd8c65764e7f091f8f2af6097c810
parenta2a074ef396f8738d9ee08ceefa8811381a4fe4f (diff)
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 <dan.carpenter@oracle.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
-rw-r--r--drivers/infiniband/core/uverbs_cmd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 3128821ca36e..062a86c04123 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: