From: Felipe Pena <felipensp@gmail.com>
To: "James E.J. Bottomley" <jejb@parisc-linux.org>,
linux-parisc@vger.kernel.org, Michal Hocko <mhocko@suse.cz>,
Johannes Weiner <hannes@cmpxchg.org>,
linux-kernel@vger.kernel.org,
Kautuk Consul <consul.kautuk@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Helge Deller <deller@gmx.de>
Cc: Felipe Pena <felipensp@gmail.com>
Subject: [PATCH 1/1] arch/parisc: mm: fix uninitialized variable usage
Date: Sun, 22 Sep 2013 15:17:46 -0300 [thread overview]
Message-ID: <1379873866-29219-1-git-send-email-felipensp@gmail.com> (raw)
The FAULT_FLAG_WRITE flag has been set based on uninitialized variable
Signed-off-by: Felipe Pena <felipensp@gmail.com>
---
arch/parisc/mm/fault.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c
index d10d27a..6b38026 100644
--- a/arch/parisc/mm/fault.c
+++ b/arch/parisc/mm/fault.c
@@ -182,8 +182,6 @@ void do_page_fault(struct pt_regs *regs, unsigned long code,
if (user_mode(regs))
flags |= FAULT_FLAG_USER;
- if (acc_type & VM_WRITE)
- flags |= FAULT_FLAG_WRITE;
retry:
down_read(&mm->mmap_sem);
vma = find_vma_prev(mm, address, &prev_vma);
@@ -201,6 +199,9 @@ good_area:
if ((vma->vm_flags & acc_type) != acc_type)
goto bad_area;
+ if (acc_type & VM_WRITE)
+ flags |= FAULT_FLAG_WRITE;
+
/*
* If for any reason at all we couldn't handle the fault, make
* sure we exit gracefully rather than endlessly redo the
--
1.7.10.4
next reply other threads:[~2013-09-22 18:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-22 18:17 Felipe Pena [this message]
2013-09-22 22:58 ` Johannes Weiner
2013-09-23 0:23 ` Felipe Pena
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=1379873866-29219-1-git-send-email-felipensp@gmail.com \
--to=felipensp@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=consul.kautuk@gmail.com \
--cc=deller@gmx.de \
--cc=hannes@cmpxchg.org \
--cc=jejb@parisc-linux.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=mhocko@suse.cz \
/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
all inboxes | Powered by JetHome®