Commit 9230fbc5 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] befs: fix resource leak on register_filesystem failure

From: Will Dyson <will_dyson@pobox.com>

Remember to free the inode cache if register_filesystem() fails.
parent 1f6fcc21
......@@ -947,9 +947,19 @@ init_befs_fs(void)
err = befs_init_inodecache();
if (err)
return err;
goto unaquire_none;
return register_filesystem(&befs_fs_type);
err = register_filesystem(&befs_fs_type);
if (err)
goto unaquire_inodecache;
return 0;
unaquire_inodecache:
befs_destroy_inodecache();
unaquire_none:
return err;
}
static void __exit
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment