From: Latchesar Ionkov <lucho@ionkov.net>
Date: Mon, 28 Nov 2005 21:44:05 +0000 (-0800)
Subject: [PATCH] v9fs: fix memory leak in v9fs dentry code
X-Git-Tag: firefly_0821_release~39706^2~45
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a93a117eaa0bec426d4671a49bfa96a6fdcd2ac9;p=firefly-linux-kernel-4.4.55.git

[PATCH] v9fs: fix memory leak in v9fs dentry code

Assign the appropriate dentry operations to the dentry. Fixes memory leak.

Signed-off-by: Latchesar Ionkov <lucho@ionkov.net>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
---

diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index be7288184fa9..0ea965c3bb7d 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -427,6 +427,8 @@ v9fs_create(struct inode *dir,
 
 	v9fs_mistat2inode(fcall->params.rstat.stat, file_inode, sb);
 	kfree(fcall);
+	fcall = NULL;
+	file_dentry->d_op = &v9fs_dentry_operations;
 	d_instantiate(file_dentry, file_inode);
 
 	if (perm & V9FS_DMDIR) {