[PATCH] v9fs: fix vfs inode derefrence before NULL check
From: Eric Van Hensbergen
Date: Fri Mar 17 2006 - 14:07:40 EST
Subject: [PATCH] Fix vfs_inode dereference before NULL check
From: Eugene Teo <eugene.teo@xxxxxxxxxxxxx>
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@xxxxxxxxxxxxx>
Signed-off-by: Eric Van Hensbergen <ericvh@xxxxxxxxx>
---
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/