aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Dong <hao.bigrat@gmail.com>2012-03-12 13:44:58 +0800
committerJohn Rigby <john.rigby@linaro.org>2012-06-20 14:23:00 -0600
commite012e5243b2c0cfee062c7aaf7691c5d9a0e6b0d (patch)
tree2f102b66c2710d9239928b2bc9268a84c3c3833b
parent2fec0e3c4a4d6d3f7e16a64214821284b6fd7428 (diff)
UBUNTU: ubuntu: overlayfs -- overlayfs: fix possible leak in ovl_new_inode
After allocating a new inode, if the mode of inode is incorrect, we should release it by iput(). Signed-off-by: Robin Dong <sanbai@taobao.com> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
-rw-r--r--fs/overlayfs/inode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c
index c220ea745f2..86bf66346ad 100644
--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c
@@ -376,6 +376,7 @@ struct inode *ovl_new_inode(struct super_block *sb, umode_t mode,
default:
WARN(1, "illegal file type: %i\n", mode);
+ iput(inode);
inode = NULL;
}