lkml.org 
[lkml]   [2006]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/6] 9p: Fix error handling on superblock alloc failure [try #7]
Date
The attached patch adds error handling and cleanup in the case that sget()
fails, lest a memory leak occur.

Signed-Off-By: David Howells <dhowells@redhat.com>
---

fs/9p/vfs_super.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index bca1efb..17dee27 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -134,8 +134,11 @@ static int v9fs_get_sb(struct file_syste
}

sb = sget(fs_type, NULL, v9fs_set_super, v9ses);
- if (IS_ERR(sb))
+ if (IS_ERR(sb)) {
+ v9fs_session_close(v9ses);
+ kfree(v9ses);
return PTR_ERR(sb);
+ }

v9fs_fill_super(sb, v9ses, flags);

-
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/

\
 
 \ /
  Last update: 2006-03-08 21:34    [W:0.192 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site