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)
committerJoerg Roedel <jroedel@suse.de>
Wed, 12 Jun 2019 08:32:23 +0000 (10:32 +0200)
commitad0834dedaa15c3a176f783c0373f836e44b4700
treede3880f977eebefdbc0860c61c83ccbb035009c3
parent2de03c11171544bd23e18539f65b3b561d57ff76
iommu: Fix a leak in iommu_insert_resv_region

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>
drivers/iommu/iommu.c