diff options
author | cognet <cognet@FreeBSD.org> | 2012-11-16 00:14:02 +0000 |
---|---|---|
committer | cognet <cognet@FreeBSD.org> | 2012-11-16 00:14:02 +0000 |
commit | 609262549022c7dfc242fe62691faea879f1a2e7 (patch) | |
tree | 57b00019b700f704a511540d7e4e65c6cb7d6c09 | |
parent | de6d0cfc51087e8fb97a8da1e1544a1e10b1001e (diff) | |
download | FreeBSD-src-609262549022c7dfc242fe62691faea879f1a2e7.zip FreeBSD-src-609262549022c7dfc242fe62691faea879f1a2e7.tar.gz |
Don't forget to unlock the pmap lock on failure.
-rw-r--r-- | sys/arm/arm/pmap-v6.c | 8 |
1 files 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); |