summaryrefslogtreecommitdiffstats
path: root/fs/9p
diff options
context:
space:
mode:
authorEugene Teo <eugene.teo@eugeneteo.net>2006-03-25 03:07:27 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-25 08:22:54 -0800
commitc0291a05f8e6a72c9807b0e2a369ee82bec659c3 (patch)
treedd93c9a70965005bd72be09797d064b1738656dc /fs/9p
parent16cce6d27ef52e00cc124196046bbae7150024c1 (diff)
downloadlinux-c0291a05f8e6a72c9807b0e2a369ee82bec659c3.tar.bz2
[PATCH] v9fs: fix vfs_inode dereference before NULL check
__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> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/9p')
-rw-r--r--fs/9p/vfs_inode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index dc67f83d0dae..4cbfb714c6e4 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -1244,6 +1244,8 @@ v9fs_vfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev)
return -EINVAL;
name = __getname();
+ if (!name)
+ return -ENOMEM;
/* build extension */
if (S_ISBLK(mode))
sprintf(name, "b %u %u", MAJOR(rdev), MINOR(rdev));