提交 c0291a05 编写于 作者: E Eugene Teo 提交者: Linus Torvalds

[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: NEugene Teo <eugene.teo@eugeneteo.net>
Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 16cce6d2
......@@ -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));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册