diff --git a/fs/exfat/exfat_core.c b/fs/exfat/exfat_core.c index 9fb6b84f2848..07befe78d03c 100644 --- a/fs/exfat/exfat_core.c +++ b/fs/exfat/exfat_core.c @@ -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");