Skip to contentSkip to conversation

v9fs: fix vfs inode derefrence before NULL check

PATCH New Eric Van Hensbergen 1 participant 1 message Mar 17, 2006 9P file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 v9fs: fix vfs inode derefrence before NULL check

Subject: [PATCH] Fix vfs_inode dereference before NULL check
From: Eugene Teo <[email protected]>
Date: 1142478004 +0800

__getname, which in turn will call kmem_cache_alloc, may return NULL.

Coverity bug #977

---

 fs/9p/vfs_inode.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

f59413fce41e7979075143d1a8b1d0359c4210bf

fs/9p/vfs_inode.c +2 -0
index 3ad8455..3438e6a 100644
@@ -1254,6 +1254,8 @@ v9fs_vfs_mknod(struct inode *dir, struct
 		return -EINVAL;
 
 	name = __getname();
+	if (!name)
+		return -EINVAL;
 	/* build extension */
 	if (S_ISBLK(mode))
 		sprintf(name, "b %u %u", MAJOR(rdev), MINOR(rdev));
Signature · 1 line
1.1.0