]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
exfat: avoid incorrectly releasing for root inode
authorChen Li <chenli@uniontech.com>
Wed, 9 Jun 2021 03:48:55 +0000 (11:48 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Mar 2022 07:57:07 +0000 (09:57 +0200)
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 <chenli@uniontech.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Cc: Tadeusz Struk <tadeusz.struk@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/exfat/super.c

index cd04c912f02e068d6cac2850e900a575e8191189..ba70ed1c980490cf593232722fe1e579459e0e7d 100644 (file)
@@ -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;