diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c index ca616f2f2c8a..41d5090b237b 100644 --- a/fs/exfat/namei.c +++ b/fs/exfat/namei.c @@ -395,6 +395,9 @@ static int exfat_find_empty_entry(struct inode *inode, inode->i_blocks += sbi->cluster_size >> 9; } + if (dentry < 0) + return dentry; + p_dir->dir = exfat_sector_to_cluster(sbi, es->bh[0]->b_blocknr); p_dir->size -= dentry / sbi->dentries_per_clu;