From patchwork Sun Sep 22 18:17:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Pena X-Patchwork-Id: 2924811 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 431E7BFF05 for ; Sun, 22 Sep 2013 18:17:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7090A2053A for ; Sun, 22 Sep 2013 18:17:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9A11020535 for ; Sun, 22 Sep 2013 18:17:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752330Ab3IVSRe (ORCPT ); Sun, 22 Sep 2013 14:17:34 -0400 Received: from mail-ye0-f180.google.com ([209.85.213.180]:34713 "EHLO mail-ye0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752255Ab3IVSRd (ORCPT ); Sun, 22 Sep 2013 14:17:33 -0400 Received: by mail-ye0-f180.google.com with SMTP id m15so895686yen.39 for ; Sun, 22 Sep 2013 11:17:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=wMgYasm2m4dTVv8TU4UD25ItVfv4oqrHUUu2nsEDDZo=; b=UMnXH8guqgj4eRPQCuRxvWlEqtBYHhGwBdYtwTj67g7MVMK6Ekc6ELcoqJR0FHTn2t 3kln1f8t2HckBC0cEJ4jZz/jSVIe/hsy6zSiqu7kZPCqmDQ2I5Avo6USV2Ru6BWrSR+m /hOlkckZsIepqSMkUqYR68ggXC5UAyujyXlHZwEw3HKpBvvKPAaY6J9eX7sKYHSElSE3 GX/X1dzxJCsfoki4FNn4RdydIQCO7UM8hAaN5lGP1O+JQhXARhKKd3BJ8KGM4zm6hKde t71/sO4jPu5AVD1i9eFha08MeNenNwHds/c/r+PCZIsF6I24LzejXvIM1IzHS36TgUOD iofg== X-Received: by 10.236.117.106 with SMTP id i70mr19845665yhh.29.1379873853012; Sun, 22 Sep 2013 11:17:33 -0700 (PDT) Received: from localhost.localdomain (189-105-138-142.user.veloxzone.com.br. [189.105.138.142]) by mx.google.com with ESMTPSA id h66sm32241391yhb.7.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 22 Sep 2013 11:17:32 -0700 (PDT) From: Felipe Pena To: "James E.J. Bottomley" , linux-parisc@vger.kernel.org, Michal Hocko , Johannes Weiner , linux-kernel@vger.kernel.org, Kautuk Consul , Andrew Morton , Helge Deller Cc: Felipe Pena Subject: [PATCH 1/1] arch/parisc: mm: fix uninitialized variable usage Date: Sun, 22 Sep 2013 15:17:46 -0300 Message-Id: <1379873866-29219-1-git-send-email-felipensp@gmail.com> X-Mailer: git-send-email 1.7.10.4 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The FAULT_FLAG_WRITE flag has been set based on uninitialized variable Signed-off-by: Felipe Pena --- 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