]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
IB/mlx4: Fix memory leaks
authorWenwen Wang <wenwen@cs.uga.edu>
Sun, 18 Aug 2019 20:23:01 +0000 (15:23 -0500)
committerKhalid Elmously <khalid.elmously@canonical.com>
Thu, 26 Sep 2019 04:34:52 +0000 (00:34 -0400)
commite96d600d474e0fe9cb8dec946a3b3fe4681f2310
tree2b321cf3410caeab54efd25b847ecf63d8c0f7bc
parentc89cc1c61ea3ca54056c6aab7e86c32001ea417c
IB/mlx4: Fix memory leaks

BugLink: https://bugs.launchpad.net/bugs/1843463
[ Upstream commit 5c1baaa82cea2c815a5180ded402a7cd455d1810 ]

In mlx4_ib_alloc_pv_bufs(), 'tun_qp->tx_ring' is allocated through
kcalloc(). However, it is not always deallocated in the following execution
if an error occurs, leading to memory leaks. To fix this issue, free
'tun_qp->tx_ring' whenever an error occurs.

Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Acked-by: Leon Romanovsky <leonro@mellanox.com>
Link: https://lore.kernel.org/r/1566159781-4642-1-git-send-email-wenwen@cs.uga.edu
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/infiniband/hw/mlx4/mad.c