diff mbox series

exfat: avoid incorrectly releasing for root inode

Message ID 87a6nz4s0o.wl-chenli@uniontech.com (mailing list archive)
State New
Headers show
Series exfat: avoid incorrectly releasing for root inode | expand

Commit Message

Chen Li June 9, 2021, 3:48 a.m. UTC
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>
---
 fs/exfat/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Namjae Jeon June 12, 2021, 12:57 a.m. UTC | #1
2021-06-09 12:48 GMT+09:00, Chen Li <chenli@uniontech.com>:
>
> 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>
merged into #dev, Thanks for your patch!
diff mbox series

Patch

diff --git a/fs/exfat/super.c b/fs/exfat/super.c
index d38d17a77e76..5539ffc20d16 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;