summaryrefslogtreecommitdiffstats
path: root/fs/jffs2/super.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-04-03 05:56:44 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2018-04-16 05:49:05 +0200
commitc66b23c2840446a82c389e4cb1a12eb2a71fa2e4 (patch)
tree4d432cec255e8e7eef62f1eda55f8e997e29d598 /fs/jffs2/super.c
parenthypfs_kill_super(): deal with failed allocations (diff)
downloadlinux-c66b23c2840446a82c389e4cb1a12eb2a71fa2e4.tar.xz
linux-c66b23c2840446a82c389e4cb1a12eb2a71fa2e4.zip
jffs2_kill_sb(): deal with failed allocations
jffs2_fill_super() might fail to allocate jffs2_sb_info; jffs2_kill_sb() must survive that. Cc: stable@kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/jffs2/super.c')
-rw-r--r--fs/jffs2/super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
index f60dee7faf03..87bdf0f4cba1 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -342,7 +342,7 @@ static void jffs2_put_super (struct super_block *sb)
static void jffs2_kill_sb(struct super_block *sb)
{
struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);
- if (!sb_rdonly(sb))
+ if (c && !sb_rdonly(sb))
jffs2_stop_garbage_collect_thread(c);
kill_mtd_super(sb);
kfree(c);