Skip to content

Commit

Permalink
powerpc/pkeys: Fix calculation of total pkeys.
Browse files Browse the repository at this point in the history
Total number of pkeys calculation is off by 1. Fix it.

Fixes: 4fb158f ("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>
  • Loading branch information
Ram Pai authored and Michael Ellerman committed Jul 24, 2018
1 parent c76662e commit fe6a280
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/mm/pkeys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fe6a280

Please sign in to comment.