From: Shiyong Li Date: Sat, 9 Dec 2017 01:38:24 +0000 (-0800) Subject: fs/exfat: do error check for d_splice_alias return X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0d57c54455ece1014806ffeaa42d0504b3fb8248;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git fs/exfat: do error check for d_splice_alias return This patch adds error check in case a defect exFAT SD cards is inserted. Change-Id: I37f6b8716abd556908aad72b18fcc7ac5719766e Signed-off-by: Min Shi Signed-off-by: Shiyong Li Reviewed-on: https://gerrit.mot.com/1102184 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Igor Kovalenko Submit-Approved: Jira Key Reviewed-on: https://gerrit.mot.com/1276885 Reviewed-by: Hua Tan --- diff --git a/fs/exfat/exfat_super.c b/fs/exfat/exfat_super.c index 2e041cdede7e..24159668960f 100644 --- a/fs/exfat/exfat_super.c +++ b/fs/exfat/exfat_super.c @@ -873,7 +873,7 @@ out: } #else dentry = d_splice_alias(inode, dentry); - if (dentry) + if (dentry && !IS_ERR(dentry)) dentry->d_time = dentry->d_parent->d_inode->i_version; #endif DPRINTK("exfat_lookup exited 2\n");