mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 06:31:58 +02:00
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>
This commit is contained in:
parent
d1d75eaf01
commit
73f0125800
|
|
@ -874,9 +874,10 @@ static struct dentry *exfat_mkdir(struct mnt_idmap *idmap, struct inode *dir,
|
|||
|
||||
i_pos = exfat_make_i_pos(&info);
|
||||
inode = exfat_build_inode(sb, &info, i_pos);
|
||||
err = PTR_ERR_OR_ZERO(inode);
|
||||
if (err)
|
||||
if (IS_ERR(inode)) {
|
||||
err = PTR_ERR(inode);
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
inode_inc_iversion(inode);
|
||||
EXFAT_I(inode)->i_crtime = simple_inode_init_ts(inode);
|
||||
|
|
@ -887,7 +888,7 @@ static struct dentry *exfat_mkdir(struct mnt_idmap *idmap, struct inode *dir,
|
|||
|
||||
unlock:
|
||||
mutex_unlock(&EXFAT_SB(sb)->s_lock);
|
||||
return ERR_PTR(err);
|
||||
return err ? ERR_PTR(err) : NULL;
|
||||
}
|
||||
|
||||
static int exfat_check_dir_empty(struct super_block *sb,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user