1
0
Fork 0

jffs2_kill_sb(): deal with failed allocations

commit c66b23c284 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
pull/10/head
Al Viro 2018-04-02 23:56:44 -04:00 committed by Greg Kroah-Hartman
parent 22ec5ee710
commit c780ac96e1
1 changed files with 1 additions and 1 deletions

View File

@ -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);