]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/mm/radix: Fix always false comparison against MMU_NO_CONTEXT
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Thu, 2 Jun 2016 09:44:48 +0000 (15:14 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 8 Jun 2016 03:56:53 +0000 (13:56 +1000)
commitcc59ea615d0b92576e20a87db8dcae920eaa3063
tree9a61c35310aa07be57b3901b0757f6a2134b6e6f
parentfd5256516845572f61c8620151221ea0f4a5766f
powerpc/mm/radix: Fix always false comparison against MMU_NO_CONTEXT

In some of the radix TLB flush routines, we use a local to store the
mm->context.id, AKA the PID.

Currently we use an int, but the PID is unsigned long, so large values
of PID will be truncated. In particular MMU_NO_CONTEXT is -1, which
means all our comparisons against that value can never be true.

This means we'll issue TLB flushes when we shouldn't on radix enabled
machines.

Fix it by using an unsigned long for the local. Discovered by Coverity.

Fixes: 0a3b7547a068 ("powerpc/mm/radix: Add tlbflush routines")
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Reviewed-by: Balbir Singh <bsingharora@gmail.com>
[mpe: Write change log]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/tlb-radix.c