HomeFreeBSD

iommu_gas: Avoid double unmapping on error

Description

iommu_gas: Avoid double unmapping on error

In the extremely unlikely case that the iommu_gas_map_region() call in
bus_dma_iommu_load_ident() failed, we would attempt to unmap the failed
entry twice, first in iommu_gas_map_region(), and a second time in the
caller. Once is enough, and twice is problematic because it leads to a
second RB_REMOVE call on the same tree node. Like it or not, RB_TREE
does not handle that possibility.

Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35869

Details

Provenance
alcAuthored on Jul 21 2022, 6:53 AM
Reviewer
kib
Differential Revision
D35869: iommu_gas: Avoid double unmapping on error
Parents
rG36e08b0127f9: Bug fix to UFS/FFS superblock integrity checks when reading a superblock.
Branches
Unknown
Tags
Unknown