Andrew Price 49ee6220be gfs2: Don't leave s_fs_info pointing to freed memory in init_sbd
commit 4c62bd9cea7bcf10292f7e4c57a2bca332942697 upstream.

When alloc_percpu() fails, sdp gets freed but sb->s_fs_info still points
to the same address. Move the assignment after that error check so that
s_fs_info can only point to a valid sdp or NULL, which is checked for
later in the error path, in gfs2_kill_super().

Reported-by: syzbot+dcb8b3587445007f5808@syzkaller.appspotmail.com
Signed-off-by: Andrew Price <anprice@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-01 09:42:51 +01:00
..
2016-05-12 22:28:05 -04:00
2018-09-26 08:37:59 +02:00
2016-06-27 09:47:09 -05:00
2016-06-27 09:47:08 -05:00
2018-05-30 07:52:35 +02:00
2017-09-25 12:32:33 -05:00
2017-08-09 09:36:39 -05:00
2016-08-02 12:05:27 -05:00
2017-08-25 18:47:18 -05:00
2016-06-07 13:41:38 -06:00
2018-05-30 07:52:35 +02:00
2018-11-21 09:24:15 +01:00
2017-04-19 08:25:43 -04:00
2017-08-25 18:47:18 -05:00