git: 895d8b1d3c33 - stable/13 - iommu_gas: Add a missing error-case unlock
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 06 Jul 2022 17:05:08 UTC
The branch stable/13 has been updated by dougm:
URL: https://cgit.FreeBSD.org/src/commit/?id=895d8b1d3c33e29d98a91fe96c7cac328557f6e5
commit 895d8b1d3c33e29d98a91fe96c7cac328557f6e5
Author: Alan Cox <alc@FreeBSD.org>
AuthorDate: 2022-06-21 04:48:31 +0000
Commit: Doug Moore <dougm@FreeBSD.org>
CommitDate: 2022-07-06 16:53:38 +0000
iommu_gas: Add a missing error-case unlock
Release the domain lock when iommu_gas_reserve_region_extend()'s call to
iommu_gas_reserve_region_locked() fails.
MFC after: 2 weeks
(cherry picked from commit 0ba1d8608234eee767b475627da6e5903ce7536a)
---
sys/dev/iommu/iommu_gas.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sys/dev/iommu/iommu_gas.c b/sys/dev/iommu/iommu_gas.c
index aa2763e4e47f..48b27d6e81dc 100644
--- a/sys/dev/iommu/iommu_gas.c
+++ b/sys/dev/iommu/iommu_gas.c
@@ -786,8 +786,10 @@ iommu_gas_reserve_region_extend(struct iommu_domain *domain,
if (entry_start != entry_end) {
error = iommu_gas_reserve_region_locked(domain,
entry_start, entry_end, entry);
- if (error != 0)
+ if (error != 0) {
+ IOMMU_DOMAIN_UNLOCK(domain);
break;
+ }
entry = NULL;
}
IOMMU_DOMAIN_UNLOCK(domain);