summaryrefslogtreecommitdiff
path: root/fs/jffs2
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-04-03 06:56:44 +0300
committerBen Hutchings <ben@decadent.org.uk>2018-10-21 10:45:25 +0300
commit68678f8cc31adb5ffa4153b4ca5d9c364c913d86 (patch)
treeb0f18c843b4ea2b3fdc3c30748c55b96ea093b8f /fs/jffs2
parent4275985f9f2e8b039f01e3ddea8d22256a7a5961 (diff)
downloadlinux-68678f8cc31adb5ffa4153b4ca5d9c364c913d86.tar.xz
jffs2_kill_sb(): deal with failed allocations
commit c66b23c2840446a82c389e4cb1a12eb2a71fa2e4 upstream. jffs2_fill_super() might fail to allocate jffs2_sb_info; jffs2_kill_sb() must survive that. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'fs/jffs2')
-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 0918f0e2e266..10902f70883d 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -345,7 +345,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->s_flags & MS_RDONLY))
+ if (c && !(sb->s_flags & MS_RDONLY))
jffs2_stop_garbage_collect_thread(c);
kill_mtd_super(sb);
kfree(c);