mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
powerpc/pkeys: Fix calculation of total pkeys.
commitfe6a2804e6upstream. Total number of pkeys calculation is off by 1. Fix it. Fixes:4fb158f65a("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5e2727bf84
commit
44d146b99b
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user