Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

exfat: fix passing zero to ERR_PTR() in exfat_mkdir()

Detected by Smatch.

namei.c:890 exfat_mkdir() warn:
passing zero to 'ERR_PTR'

Signed-off-by: Yang Wen <anmuxixixi@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>

authored by

Yang Wen and committed by
Namjae Jeon
73f01258 d1d75eaf

+4 -3
+4 -3
fs/exfat/namei.c
··· 874 874 875 875 i_pos = exfat_make_i_pos(&info); 876 876 inode = exfat_build_inode(sb, &info, i_pos); 877 - err = PTR_ERR_OR_ZERO(inode); 878 - if (err) 877 + if (IS_ERR(inode)) { 878 + err = PTR_ERR(inode); 879 879 goto unlock; 880 + } 880 881 881 882 inode_inc_iversion(inode); 882 883 EXFAT_I(inode)->i_crtime = simple_inode_init_ts(inode); ··· 888 887 889 888 unlock: 890 889 mutex_unlock(&EXFAT_SB(sb)->s_lock); 891 - return ERR_PTR(err); 890 + return err ? ERR_PTR(err) : NULL; 892 891 } 893 892 894 893 static int exfat_check_dir_empty(struct super_block *sb,