aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p
diff options
context:
space:
mode:
authorEugene Teo <eugene.teo@eugeneteo.net>2006-03-25 06:07:27 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-25 11:22:54 -0500
commitc0291a05f8e6a72c9807b0e2a369ee82bec659c3 (patch)
treedd93c9a70965005bd72be09797d064b1738656dc /fs/9p
parent16cce6d27ef52e00cc124196046bbae7150024c1 (diff)
[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)
1244 return -EINVAL; 1244 return -EINVAL;
1245 1245
1246 name = __getname(); 1246 name = __getname();
1247 if (!name)
1248 return -ENOMEM;
1247 /* build extension */ 1249 /* build extension */
1248 if (S_ISBLK(mode)) 1250 if (S_ISBLK(mode))
1249 sprintf(name, "b %u %u", MAJOR(rdev), MINOR(rdev)); 1251 sprintf(name, "b %u %u", MAJOR(rdev), MINOR(rdev));