* re: powerpc: Hugetlb for BookE
@ 2013-11-07 13:12 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2013-11-07 13:12 UTC (permalink / raw)
To: beckyb; +Cc: linuxppc-dev
Hello Becky Bruce,
This is a semi-automatic email about new static checker warnings.
The patch 41151e77a4d9: "powerpc: Hugetlb for BookE" from Jun 28,
2011, leads to the following Smatch complaint:
arch/powerpc/mm/hugetlbpage-book3e.c:120 flush_hugetlb_page()
warn: variable dereferenced before check 'vma' (see line 117)
arch/powerpc/mm/hugetlbpage-book3e.c
116 {
117 struct hstate *hstate = hstate_file(vma->vm_file);
^^^^^^^^^^^^
Dereference.
118 unsigned long tsize = huge_page_shift(hstate) - 10;
119
120 __flush_tlb_page(vma ? vma->vm_mm : NULL, vmaddr, tsize, 0);
^^^
Check is too late.
121
122 }
Also in the caller:
arch/powerpc/mm/tlb_nohash.c
305 void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
306 {
307 #ifdef CONFIG_HUGETLB_PAGE
308 if (is_vm_hugetlb_page(vma))
^^^^^^^^^^^^^^^^^^^^^^
Dereferenced inside is_vm_hugetlb_page().
309 flush_hugetlb_page(vma, vmaddr);
310 #endif
311
312 __flush_tlb_page(vma ? vma->vm_mm : NULL, vmaddr,
313 mmu_get_tsize(mmu_virtual_psize), 0);
314 }
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-11-07 14:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-07 13:12 powerpc: Hugetlb for BookE Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).