mirror of
https://github.com/torvalds/linux.git
synced 2024-12-28 13:51:44 +00:00
[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>
This commit is contained in:
parent
16cce6d27e
commit
c0291a05f8
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user