Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751121AbWCCKuJ (ORCPT ); Fri, 3 Mar 2006 05:50:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751181AbWCCKuJ (ORCPT ); Fri, 3 Mar 2006 05:50:09 -0500 Received: from mx1.redhat.com ([66.187.233.31]:52610 "EHLO mx1.redhat.com") by vger.kernel.org with ESMTP id S1751121AbWCCKuH (ORCPT ); Fri, 3 Mar 2006 05:50:07 -0500 From: David Howells In-Reply-To: <20060302213356.7282.26463.stgit@warthog.cambridge.redhat.com> References: <20060302213356.7282.26463.stgit@warthog.cambridge.redhat.com> To: torvalds@osdl.org, akpm@osdl.org, steved@redhat.com, trond.myklebust@fys.uio.no, aviro@redhat.com Cc: linux-fsdevel@vger.kernel.org, linux-cachefs@redhat.com, nfsv4@linux-nfs.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/5] 9p: Fix error handling on superblock alloc failure X-Mailer: MH-E 7.92+cvs; nmh 1.1; GNU Emacs 22.0.50.4 Date: Fri, 03 Mar 2006 10:49:49 +0000 Message-ID: <19741.1141382989@warthog.cambridge.redhat.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 891 Lines: 29 The attached patch adds error handling and cleanup in the case that sget() fails, lest a memory leak occur. Signed-Off-By: David Howells --- fs/9p/vfs_super.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c index aedc97b..17dee27 100644 --- a/fs/9p/vfs_super.c +++ b/fs/9p/vfs_super.c @@ -135,7 +135,8 @@ static int v9fs_get_sb(struct file_syste sb = sget(fs_type, NULL, v9fs_set_super, v9ses); if (IS_ERR(sb)) { -#error this should have error handling in case sget() fails + v9fs_session_close(v9ses); + kfree(v9ses); return PTR_ERR(sb); } - 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/