public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] LogFS: Fix oops on failed mount
@ 2010-04-15  0:56 Kevin Cernekee
  2010-04-15  6:16 ` Jörn Engel
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Cernekee @ 2010-04-15  0:56 UTC (permalink / raw)
  To: joern; +Cc: logfs, linux-kernel

logfs_kill_sb() calls mempool_destroy() on super->s_alias_pool .  But if
logfs_kill_sb() is being called because the mount failed (e.g.
__logfs_read_sb() returned -EIO) this pointer will still be NULL,
resulting in a kernel oops.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
---
 fs/logfs/super.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/logfs/super.c b/fs/logfs/super.c
index b60bfac..f817713 100644
--- a/fs/logfs/super.c
+++ b/fs/logfs/super.c
@@ -517,7 +517,8 @@ static void logfs_kill_sb(struct super_block *sb)
 		__free_page(super->s_erase_page);
 	super->s_devops->put_device(sb);
 	mempool_destroy(super->s_btree_pool);
-	mempool_destroy(super->s_alias_pool);
+	if (super->s_alias_pool)
+		mempool_destroy(super->s_alias_pool);
 	kfree(super);
 	log_super("LogFS: Finished unmounting\n");
 }
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-15  6:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-15  0:56 [PATCH] LogFS: Fix oops on failed mount Kevin Cernekee
2010-04-15  6:16 ` Jörn Engel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox