Skip to contentSkip to conversation

csky: Cache and TLB routines

bug report Dan Carpenter 1 participant 1 message May 3, 2019 Kernel janitors

lore
Share & tools
lore
#0 lore raw

Hello Guo Ren,

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

The patch 00a9730e1007: "csky: Cache and TLB routines" from Sep 5, 2018, leads to the following Smatch complaint:

./arch/csky/mm/tlb.c:130 flush_tlb_page()
warn: variable dereferenced before check 'vma' (see line 128)

./arch/csky/mm/tlb.c
127 int cpu = smp_processor_id();

   128		int newpid = cpu_asid(cpu, vma->vm_mm);
                                           ^^^^^^^^^^

Dereferenced

129

   130		if (!vma || cpu_context(cpu, vma->vm_mm) != 0) {
                    ^^^^

Checked too late.

   131			page &= (PAGE_MASK << 1);
   132	

regards,
dan carpenter