Skip to contentSkip to conversation

powerpc/mm: avoid null pointer dereference in flush_tlb_mm

PATCH New Defang Bo 1 participant 1 message Dec 25, 2020 PowerPC

lore
Share & tools
lore

Defang Bo

author
#0 lore raw

PATCH 1/1 powerpc/mm: avoid null pointer dereference in flush_tlb_mm

Similar to commit<0dc294f7>, there should be a check for 'mm' to prevent Null pointer dereference in case of 'mm' argument was legitimately passed.

---
 arch/powerpc/mm/nohash/tlb.c | 3 +++
 1 file changed, 3 insertions(+)
arch/powerpc/mm/nohash/tlb.c +3 -0
index 5872f69..09796c9 100644
@@ -268,6 +268,9 @@ void flush_tlb_mm(struct mm_struct *mm)
 {
 	unsigned int pid;
 
+	if (unlikely(!mm))
+		return;
+
 	preempt_disable();
 	pid = mm->context.id;
 	if (unlikely(pid == MMU_NO_CONTEXT))
Signature · 1 line
2.7.4