exfat:fixed fs_error access null pointer

when exfat unmounted, but fs_error maybe callbacked by block layer
still.so just check whether the sb and sb_fs_info was released.

Change-Id: I30f55a2f3a20cbaecccbcf12d143590a02d1bf19
Signed-off-by: yuedl1 <yuedl1@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1708296
Tested-by: Jira Key
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Reviewed-by: Zhenxin Xi <xizx@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
yuedl1 2020-07-29 13:36:13 +08:00 • committed by Dongliang Yue
commit 48b1ef558f

View file

@ -1753,8 +1753,14 @@ void fs_sync(struct super_block *sb, s32 do_sync)
void fs_error(struct super_block *sb)
{
struct exfat_mount_options *opts = &EXFAT_SB(sb)->options;
struct exfat_sb_info *sbi = EXFAT_SB(sb);
struct exfat_mount_options *opts;
struct exfat_sb_info *sbi;
if ( sb == NULL || EXFAT_SB(sb)== NULL) {
printk(KERN_ERR "[EXFAT] filesystem maybe unmounted!!!\n");
return;
}
opts = &EXFAT_SB(sb)->options;
sbi = EXFAT_SB(sb);
if (opts->errors == EXFAT_ERRORS_PANIC)
panic("[EXFAT] Filesystem panic from previous error\n");