From: Chen Li Date: Wed, 9 Jun 2021 03:48:55 +0000 (+0800) Subject: exfat: avoid incorrectly releasing for root inode X-Git-Tag: v5.10.109~35 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9eeaa2d7d58ae7fe66bdb016a03fe251c48fe222;p=users%2Fdwmw2%2Flinux.git exfat: avoid incorrectly releasing for root inode commit 839a534f1e853f1aec100d06040c0037b89c2dc3 upstream. In d_make_root, when we fail to allocate dentry for root inode, we will iput root inode and returned value is NULL in this function. So we do not need to release this inode again at d_make_root's caller. Signed-off-by: Chen Li Signed-off-by: Namjae Jeon Cc: Tadeusz Struk Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/exfat/super.c b/fs/exfat/super.c index cd04c912f02e0..ba70ed1c98049 100644 --- a/fs/exfat/super.c +++ b/fs/exfat/super.c @@ -690,7 +690,7 @@ static int exfat_fill_super(struct super_block *sb, struct fs_context *fc) if (!sb->s_root) { exfat_err(sb, "failed to get the root dentry"); err = -ENOMEM; - goto put_inode; + goto free_table; } return 0;