From: "Kenichi Okuyama" <kenichi.okuyama@gmail.com>
To: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org
Subject: [patch] NULL pointer check for vma->vm_mm
Date: Fri, 1 Feb 2008 16:39:07 +0900 [thread overview]
Message-ID: <3fd7d7a70801312339p2a142096p83ed286c81379728@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 455 bytes --]
Dear all,
I was looking at the ./mm/rmap.c .. I found that, in function
"page_referenced_one()",
struct mm_struct *mm = vma->vm_mm;
was being refererred without NULL check.
Though I do agree that this works for most of the cases, I thought it
is better to add
BUG_ON() for case of mm being NULL.
attached is the patch for this
thank you in advance for taking your time.
best regards,
--
(Kenichi Okuyama)
URL: http://www.dd.iij4u.or.jp/~okuyamak/
[-- Attachment #2: patch.mm --]
[-- Type: application/octet-stream, Size: 316 bytes --]
--- ./mm/rmap.c.orig 2008-02-01 15:36:50.000000000 +0900
+++ ./mm/rmap.c 2008-02-01 15:42:43.000000000 +0900
@@ -276,6 +276,8 @@ static int page_referenced_one(struct pa
spinlock_t *ptl;
int referenced = 0;
+ BUG_ON(( mm == NULL ));
+
address = vma_address(page, vma);
if (address == -EFAULT)
goto out;
next reply other threads:[~2008-02-01 7:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-01 7:39 Kenichi Okuyama [this message]
2008-02-01 7:55 ` [patch] NULL pointer check for vma->vm_mm Andrew Morton
2008-02-01 8:24 ` Kenichi Okuyama
2008-02-01 10:19 ` Andrew Morton
2008-02-01 17:39 ` Kenichi Okuyama
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=3fd7d7a70801312339p2a142096p83ed286c81379728@mail.gmail.com \
--to=kenichi.okuyama@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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).