mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Van Hensbergen <ericvh@hera.kernel.org>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org,
	v9fs-developer@lists.sourceforge.net, ericvh@gmail.com
Subject: [PATCH] v9fs: fix vfs inode derefrence before NULL check
Date: Fri, 17 Mar 2006 19:10:01 GMT	[thread overview]
Message-ID: <200603171910.k2HJA1P6006243@hera.kernel.org> (raw)

Subject: [PATCH] Fix vfs_inode dereference before NULL check
From: Eugene Teo <eugene.teo@eugeneteo.net>
Date: 1142478004 +0800

__getname, which in turn will call kmem_cache_alloc, may return NULL.

Coverity bug #977

Signed-off-by: Eugene Teo <eugene.teo@eugeneteo.net>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>

---

 fs/9p/vfs_inode.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

f59413fce41e7979075143d1a8b1d0359c4210bf
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 3ad8455..3438e6a 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -1254,6 +1254,8 @@ v9fs_vfs_mknod(struct inode *dir, struct
 		return -EINVAL;
 
 	name = __getname();
+	if (!name)
+		return -EINVAL;
 	/* build extension */
 	if (S_ISBLK(mode))
 		sprintf(name, "b %u %u", MAJOR(rdev), MINOR(rdev));
-- 
1.1.0

                 reply	other threads:[~2006-03-17 19:10 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=200603171910.k2HJA1P6006243@hera.kernel.org \
    --to=ericvh@hera.kernel.org \
    --cc=akpm@osdl.org \
    --cc=ericvh@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=v9fs-developer@lists.sourceforge.net \
    /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

Powered by JetHome