[PATCH 1/4] omfs: fix memory leak

From: Bob Copeland
Date: Wed Jul 14 2010 - 23:28:12 EST


From: Davidlohr Bueso <dave.bueso@xxxxxxxxx>

In the error path of omfs_fill_super(), the FS super block info
(sbi) is not being freed. Correct this.

Signed-off-by: Davidlohr Bueso <dave@xxxxxxx>
Signed-off-by: Bob Copeland <me@xxxxxxxxxxxxxxx>
---
fs/omfs/inode.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c
index 089839a..b5d6380 100644
--- a/fs/omfs/inode.c
+++ b/fs/omfs/inode.c
@@ -529,6 +529,8 @@ out_brelse_bh2:
out_brelse_bh:
brelse(bh);
end:
+ if (ret)
+ kfree(sbi);
return ret;
}

--
1.5.6.5


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/