summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm
diff options
context:
space:
mode:
authorRam Pai <linuxram@us.ibm.com>2018-07-17 06:51:06 -0700
committerMichael Ellerman <mpe@ellerman.id.au>2018-07-24 21:35:09 +1000
commitfe6a2804e65969a574377bdb3605afb79e6091a9 (patch)
tree91ded5205f3b862ecfaf5d1e8c7000e288886c0c /arch/powerpc/mm
parentc76662e825f507b98938dc3bb141c4505bd4968c (diff)
downloadop-kernel-dev-fe6a2804e65969a574377bdb3605afb79e6091a9.zip
op-kernel-dev-fe6a2804e65969a574377bdb3605afb79e6091a9.tar.gz
powerpc/pkeys: Fix calculation of total pkeys.
Total number of pkeys calculation is off by 1. Fix it. Fixes: 4fb158f65ac5 ("powerpc: track allocation status of all pkeys") Cc: stable@vger.kernel.org # v4.16+ Signed-off-by: Ram Pai <linuxram@us.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r--arch/powerpc/mm/pkeys.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/mm/pkeys.c b/arch/powerpc/mm/pkeys.c
index 8f0052b..04f6597 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);
OpenPOWER on IntegriCloud