]> www.infradead.org Git - users/dwmw2/linux.git/commit
iommu: Fix a leak in iommu_insert_resv_region
authorEric Auger <eric.auger@redhat.com>
Mon, 3 Jun 2019 06:53:30 +0000 (08:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jul 2019 05:28:24 +0000 (07:28 +0200)
commit6eb4ac7a14c5d3d158937aaaaf2dea24cd08e5dc
tree22595ea1ff27240fd3715562fa5d8e8853af0734
parent8231f0a084ea5e61163b3dfdfb280924950aa29e
iommu: Fix a leak in iommu_insert_resv_region

[ Upstream commit ad0834dedaa15c3a176f783c0373f836e44b4700 ]

In case we expand an existing region, we unlink
this latter and insert the larger one. In
that case we should free the original region after
the insertion. Also we can immediately return.

Fixes: 6c65fb318e8b ("iommu: iommu_get_group_resv_regions")
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/iommu.c