Blob Blame History Raw
From 839a534f1e853f1aec100d06040c0037b89c2dc3 Mon Sep 17 00:00:00 2001
From: Chen Li <chenli@uniontech.com>
Date: Wed, 9 Jun 2021 11:48:55 +0800
Subject: [Backport 839a534f1e85] exfat: avoid incorrectly releasing for root
 inode

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>
---
 src/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/super.c b/src/super.c
index d38d17a77e76c45a006abeae532a6ae3170529d7..5539ffc20d16413a8e007aa8b00e8254887be66d 100644
--- a/src/super.c
+++ b/src/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;
-- 
2.31.1