linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: beckyb@kernel.crashing.org
Cc: linuxppc-dev@lists.ozlabs.org
Subject: re: powerpc: Hugetlb for BookE
Date: Thu, 7 Nov 2013 05:12:47 -0800 (PST)	[thread overview]
Message-ID: <20131107131247.GA13911@elgon.mountain> (raw)

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

                 reply	other threads:[~2013-11-07 14:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131107131247.GA13911@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=beckyb@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).