Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756379AbZAaCrj (ORCPT ); Fri, 30 Jan 2009 21:47:39 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752725AbZAaCqf (ORCPT ); Fri, 30 Jan 2009 21:46:35 -0500 Received: from kroah.org ([198.145.64.141]:54700 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752548AbZAaCqe (ORCPT ); Fri, 30 Jan 2009 21:46:34 -0500 Date: Fri, 30 Jan 2009 18:39:30 -0800 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , Willy Tarreau , Rodrigo Rubira Branco , Jake Edge , Eugene Teo , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Miklos Szeredi Subject: [patch 02/32] fuse: fix missing fput on error Message-ID: <20090131023930.GC12147@kroah.com> References: <20090131023411.032399235@mini.kroah.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="fuse-fix-missing-fput-on-error.patch" In-Reply-To: <20090131023906.GA12147@kroah.com> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1121 Lines: 45 2.6.27-stable review patch. If anyone has any objections, please let us know. ------------------ From: Miklos Szeredi commit 3ddf1e7f57237ac7c5d5bfb7058f1ea4f970b661 upstream. Fix the leaking file reference if allocation or initialization of fuse_conn failed. Signed-off-by: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman --- fs/fuse/inode.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -832,12 +832,16 @@ static int fuse_fill_super(struct super_ if (!file) return -EINVAL; - if (file->f_op != &fuse_dev_operations) + if (file->f_op != &fuse_dev_operations) { + fput(file); return -EINVAL; + } fc = new_conn(sb); - if (!fc) + if (!fc) { + fput(file); return -ENOMEM; + } fc->flags = d.flags; fc->user_id = d.user_id; -- 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/