Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755606Ab2HOPrt (ORCPT ); Wed, 15 Aug 2012 11:47:49 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:63107 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755575Ab2HOPrq (ORCPT ); Wed, 15 Aug 2012 11:47:46 -0400 From: Miklos Szeredi To: viro@ZenIV.linux.org.uk Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, hch@infradead.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, apw@canonical.com, nbd@openwrt.org, neilb@suse.de, hramrach@centrum.cz, jordipujolp@gmail.com, ezk@fsl.cs.sunysb.edu, ricwheeler@gmail.com, dhowells@redhat.com, hpj@urpla.net, sedat.dilek@googlemail.com, penberg@kernel.org, goran.cetusic@gmail.com, romain@orebokech.com, mszeredi@suse.cz, Robin Dong , Robin Dong Subject: [PATCH 09/13] overlayfs: fix possible leak in ovl_new_inode Date: Wed, 15 Aug 2012 17:48:16 +0200 Message-Id: <1345045700-9062-10-git-send-email-miklos@szeredi.hu> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1345045700-9062-1-git-send-email-miklos@szeredi.hu> References: <1345045700-9062-1-git-send-email-miklos@szeredi.hu> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 900 Lines: 31 From: Robin Dong 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 files changed, 1 insertions(+), 0 deletions(-) diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index 787761f..e854720 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.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/