powerpc/tm: Fix null pointer deference in flush_hash_page

Submitted by Michael Neuling on May 3, 2013, 1:36 a.m.


Message ID 22932.1367544974@ale.ozlabs.ibm.com
State Accepted, archived
Commit c2fd22df89365df9451d5b91da3b7bfd48122ecd
Headers show

Commit Message

Michael Neuling May 3, 2013, 1:36 a.m.
Make sure that current->thread.reg exists before we deference it in

Signed-off-by: Michael Neuling <mikey@neuling.org>
Reported-by: John J Miller <millerjo@us.ibm.com>
Cc: <stable@vger.kernel.org>

Patch hide | download patch | download mbox

diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 3e4c4ed..88ac0ee 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)) {