]> www.infradead.org Git - users/jedix/linux-maple.git/commit
RDMA/ocrdma: fix double free on pd
authorColin Ian King <colin.king@canonical.com>
Fri, 5 Jun 2015 14:47:27 +0000 (15:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Aug 2015 16:29:15 +0000 (09:29 -0700)
commitf354666d1be19af7ae671105c693bdb4633eef6b
treea4be08cf6cf387f585a4f6c5dc0a2b3435d3f455
parent32419b851e1fbad53a3908cc3bea923dfb6a1416
RDMA/ocrdma: fix double free on pd

commit 4dc544427991e3cef38ce3ae124b7e6557063bd3 upstream.

A reorganisation of the PD allocation and deallocation in commit
9ba1377daa ("RDMA/ocrdma: Move PD resource management to driver.")
introduced a double free on pd, as detected by static analysis by
smatch:

drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:682 ocrdma_alloc_pd()
  error: double free of 'pd'^

The original call to ocrdma_mbx_dealloc_pd() (which does not kfree
pd) was replaced with a call to _ocrdma_dealloc_pd() (which does
kfree pd).  The kfree following this call causes the double free,
so just remove it to fix the problem.

Fixes: 9ba1377daa ("RDMA/ocrdma: Move PD resource management to driver.")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-By: Devesh Sharma <devesh.sharma@avagotech.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c