From 609262549022c7dfc242fe62691faea879f1a2e7 Mon Sep 17 00:00:00 2001 From: cognet Date: Fri, 16 Nov 2012 00:14:02 +0000 Subject: Don't forget to unlock the pmap lock on failure. --- sys/arm/arm/pmap-v6.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c index af5480c..a44bdbf 100644 --- a/sys/arm/arm/pmap-v6.c +++ b/sys/arm/arm/pmap-v6.c @@ -2361,8 +2361,10 @@ pmap_change_attr(vm_offset_t sva, vm_size_t len, int mode) * Only supported on kernel virtual addresses, including the direct * map but excluding the recursive map. */ - if (base < DMAP_MIN_ADDRESS) + if (base < DMAP_MIN_ADDRESS) { + PMAP_UNLOCK(kernel_pmap); return (EINVAL); + } #endif for (tmpva = base; tmpva < base + size; ) { next_bucket = L2_NEXT_BUCKET(tmpva); @@ -2377,8 +2379,10 @@ pmap_change_attr(vm_offset_t sva, vm_size_t len, int mode) ptep = &l2b->l2b_kva[l2pte_index(tmpva)]; - if (*ptep == 0) + if (*ptep == 0) { + PMAP_UNLOCK(kernel_pmap); return(EINVAL); + } pte = *ptep &~ L2_S_CACHE_MASK; cpu_idcache_wbinv_range(tmpva, PAGE_SIZE); -- cgit v1.1