[PATCH 09/13] overlayfs-fix-possible-leak-in-ovl_new_inode

From: Miklos Szeredi
Date: Tue Mar 12 2013 - 11:42:47 EST


From: Robin Dong <hao.bigrat@xxxxxxxxx>

After allocating a new inode, if the mode of inode is incorrect, we should
release it by iput().

Signed-off-by: Robin Dong <sanbai@xxxxxxxxxx>
Signed-off-by: Miklos Szeredi <mszeredi@xxxxxxx>
---
fs/overlayfs/inode.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c
index 0dfa8a4..033de6f 100644
--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c
@@ -371,6 +371,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;
}

--
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/