diff options
author | Eugene Teo <eugene.teo@eugeneteo.net> | 2006-03-25 12:07:27 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-25 17:22:54 +0100 |
commit | c0291a05f8e6a72c9807b0e2a369ee82bec659c3 (patch) | |
tree | dd93c9a70965005bd72be09797d064b1738656dc /fs/9p | |
parent | [PATCH] v9fs: add extension field to Tcreate (diff) | |
download | linux-c0291a05f8e6a72c9807b0e2a369ee82bec659c3.tar.xz linux-c0291a05f8e6a72c9807b0e2a369ee82bec659c3.zip |
[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.c | 2 |
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)); |