summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@mellanox.com>2019-02-13 18:07:05 +0100
committerJason Gunthorpe <jgg@mellanox.com>2019-02-25 23:00:48 +0100
commitbb618451544ca9152a1a213d0a2b93d231c4cce1 (patch)
treec2ee489fcfdfd8c65764e7f091f8f2af6097c810 /drivers/infiniband
parentRDMA: Handle ucontext allocations by IB/core (diff)
downloadlinux-bb618451544ca9152a1a213d0a2b93d231c4cce1.tar.xz
linux-bb618451544ca9152a1a213d0a2b93d231c4cce1.zip
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>
Diffstat (limited to 'drivers/infiniband')
-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: