From: Michael Neuling Date: Thu, 2 May 2013 15:36:14 +0000 (+0000) Subject: powerpc/tm: Fix null pointer deference in flush_hash_page X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c2fd22df89365df9451d5b91da3b7bfd48122ecd;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git powerpc/tm: Fix null pointer deference in flush_hash_page Make sure that current->thread.reg exists before we deference it in flush_hash_page. Signed-off-by: Michael Neuling Reported-by: John J Miller Cc: Signed-off-by: Benjamin Herrenschmidt --- diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 3e4c4ed19335..88ac0eeaadde 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c @@ -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);