]> git.baikalelectronics.ru Git - kernel.git/commit
vdpasim: fix memory leak when freeing IOTLBs
authorJason Wang <jasowang@redhat.com>
Tue, 13 Dec 2022 09:07:17 +0000 (17:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2023 11:02:09 +0000 (12:02 +0100)
commitb409eab584d324d8840b26afb59ea0b74288fede
tree4b8a7b8eea23f44ff3bfe075563548719e93ea1f
parent23e56d958d899880a3ec298c179e9838f0d7e9ae
vdpasim: fix memory leak when freeing IOTLBs

[ Upstream commit 0b7a04a30eef20e6b24926a45c0ce7906ae85bd6 ]

After commit 3bd425936c73 ("vdpasim: control virtqueue support"),
vdpasim->iommu became an array of IOTLB, so we should clean the
mappings of each free one by one instead of just deleting the ranges
in the first IOTLB which may leak maps.

Fixes: 3bd425936c73 ("vdpasim: control virtqueue support")
Cc: Gautam Dawar <gautam.dawar@xilinx.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20221213090717.61529-1-jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Gautam Dawar <gautam.dawar@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/vdpa/vdpa_sim/vdpa_sim.c