Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Jun 2022 05:00:18 GMT
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 0ba1d8608234 - main - iommu_gas: Add a missing error-case unlock
Message-ID:  <202206210500.25L50IlW020528@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by alc:

URL: https://cgit.FreeBSD.org/src/commit/?id=0ba1d8608234eee767b475627da6e5903ce7536a

commit 0ba1d8608234eee767b475627da6e5903ce7536a
Author:     Alan Cox <alc@FreeBSD.org>
AuthorDate: 2022-06-21 04:48:31 +0000
Commit:     Alan Cox <alc@FreeBSD.org>
CommitDate: 2022-06-21 04:48:31 +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
---
 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 70eef9a0a1f7..a9c4caa30dd8 100644
--- a/sys/dev/iommu/iommu_gas.c
+++ b/sys/dev/iommu/iommu_gas.c
@@ -781,8 +781,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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202206210500.25L50IlW020528>