[bug report] powerpc/mm/radix: Avoid flushing the PWC on every flush_tlb_range

Dan Carpenter dan.carpenter at oracle.com
Sat Aug 12 06:15:44 AEST 2017


Hello Benjamin Herrenschmidt,

This is a semi-automatic email about new static checker warnings.

The patch 424de9c6e3f8: "powerpc/mm/radix: Avoid flushing the PWC on 
every flush_tlb_range" from Jul 19, 2017, leads to the following 
Smatch complaint:

arch/powerpc/mm/tlb-radix.c:368 radix__flush_tlb_collapsed_pmd()
	 error: we previously assumed 'mm' could be null (see line 362)

arch/powerpc/mm/tlb-radix.c
   361	
   362		pid = mm ? mm->context.id : 0;
                      ^^
Check for NULL.

   363		if (unlikely(pid == MMU_NO_CONTEXT))
   364			goto no_context;
   365	
   366		/* 4k page size, just blow the world */
   367		if (PAGE_SIZE == 0x1000) {
   368			radix__flush_all_mm(mm);
                                            ^^
Unchecked dereference.

   369			return;
   370		}

regards,
dan carpenter


More information about the Linuxppc-dev mailing list