Total number of pkeys calculation is off by 1. Fix it.

CC: Florian Weimer <fwei...@redhat.com>
CC: Michael Ellerman <m...@ellerman.id.au>
CC: Thiago Jung Bauermann <bauer...@linux.ibm.com>
Signed-off-by: Ram Pai <linux...@us.ibm.com>
---
 arch/powerpc/mm/pkeys.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/mm/pkeys.c b/arch/powerpc/mm/pkeys.c
index 6fc56f4..90ab793 100644
--- a/arch/powerpc/mm/pkeys.c
+++ b/arch/powerpc/mm/pkeys.c
@@ -92,7 +92,7 @@ int pkey_initialize(void)
         * arch-neutral code.
         */
        pkeys_total = min_t(int, pkeys_total,
-                       (ARCH_VM_PKEY_FLAGS >> VM_PKEY_SHIFT));
+                       ((ARCH_VM_PKEY_FLAGS >> VM_PKEY_SHIFT)+1));
 
        if (!pkey_mmu_enabled() || radix_enabled() || !pkeys_total)
                static_branch_enable(&pkey_disabled);
-- 
1.7.1

Reply via email to