orangefs_kill_sb(): deal with allocation failures
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 3 Apr 2018 04:13:17 +0000 (00:13 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Apr 2018 07:36:38 +0000 (09:36 +0200)
commit 659038428cb43a66e3eff71e2c845c9de3611a98 upstream.

orangefs_fill_sb() might've failed to allocate ORANGEFS_SB(s); don't
oops in that case.

Cc: stable@kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/orangefs/super.c

index 47ebd9bfd1a1be6c638261c4167d530cd5cb3b2a..1997ce49ab46c17f118eae221ee7017907dd4636 100644 (file)
@@ -594,6 +594,11 @@ void orangefs_kill_sb(struct super_block *sb)
        /* provided sb cleanup */
        kill_anon_super(sb);
 
+       if (!ORANGEFS_SB(sb)) {
+               mutex_lock(&orangefs_request_mutex);
+               mutex_unlock(&orangefs_request_mutex);
+               return;
+       }
        /*
         * issue the unmount to userspace to tell it to remove the
         * dynamic mount info it has for this superblock