powerpc/tm: Fix null pointer deference in flush_hash_page
authorMichael Neuling <mikey@neuling.org>
Thu, 2 May 2013 15:36:14 +0000 (15:36 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Sun, 5 May 2013 23:25:36 +0000 (09:25 +1000)
Make sure that current->thread.reg exists before we deference it in
flush_hash_page.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Reported-by: John J Miller <millerjo@us.ibm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/mm/hash_utils_64.c

index 3e4c4ed..88ac0ee 100644 (file)
@@ -1230,6 +1230,7 @@ void flush_hash_page(unsigned long vpn, real_pte_t pte, int psize, int ssize,
         * unmapping it first, it may see the speculated version.
         */
        if (local && cpu_has_feature(CPU_FTR_TM) &&
+           current->thread.regs &&
            MSR_TM_ACTIVE(current->thread.regs->msr)) {
                tm_enable();
                tm_abort(TM_CAUSE_TLBI);