From 4bda74a61de9494ec76a7d5bf6f491a8284680d8 Mon Sep 17 00:00:00 2001 From: Robin Dong Date: Mon, 12 Mar 2012 13:44:58 +0800 Subject: [PATCH 09/13] overlayfs: fix possible leak in ovl_new_inode Patch-mainline: not yet After allocating a new inode, if the mode of inode is incorrect, we should release it by iput(). Signed-off-by: Robin Dong Signed-off-by: Miklos Szeredi --- fs/overlayfs/inode.c | 1 + 1 file changed, 1 insertion(+) Index: linux-3.6-rc7-master/fs/overlayfs/inode.c =================================================================== --- linux-3.6-rc7-master.orig/fs/overlayfs/inode.c 2012-09-28 13:36:53.000000000 +0200 +++ linux-3.6-rc7-master/fs/overlayfs/inode.c 2012-09-28 13:37:02.000000000 +0200 @@ -371,6 +371,7 @@ struct inode *ovl_new_inode(struct super default: WARN(1, "illegal file type: %i\n", mode); + iput(inode); inode = NULL; }