]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
RDMA/rvt: Fix potential memory leak caused by rvt_alloc_rq
authorAditya Pakki <pakki001@umn.edu>
Sun, 14 Jun 2020 04:11:48 +0000 (23:11 -0500)
committerKhalid Elmously <khalid.elmously@canonical.com>
Sat, 8 Aug 2020 05:53:12 +0000 (01:53 -0400)
commitefe9e5dbe4fcdfac9287d10f54215ac80d91fc9d
treee5348fa5df8ddfc72f681bf0b2ae309405a2c3c8
parent1a8c217e66631ba9cd05b2c62bea9aaa4c081ebe
RDMA/rvt: Fix potential memory leak caused by rvt_alloc_rq

BugLink: https://bugs.launchpad.net/bugs/1885942
[ Upstream commit 90a239ee25fa3a483facec3de7c144361a3d3a51 ]

In case of failure of alloc_ud_wq_attr(), the memory allocated by
rvt_alloc_rq() is not freed. Fix it by calling rvt_free_rq() using the
existing clean-up code.

Fixes: d310c4bf8aea ("IB/{rdmavt, hfi1, qib}: Remove AH refcount for UD QPs")
Link: https://lore.kernel.org/r/20200614041148.131983-1-pakki001@umn.edu
Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Acked-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/infiniband/sw/rdmavt/qp.c