Skip to contentSkip to conversation

exfat: avoid incorrectly releasing for root inode

PATCH Applied Chen Li 2 participants 2 messages Jun 9, 2021 – Jun 12, 2021

Subsystems (2)
lore
Share & tools
lore

Chen Li

author
#0 lore raw

PATCH 1/1 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.

---
 fs/exfat/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/exfat/super.c +1 -1
index d38d17a77e76..5539ffc20d16 100644
@@ -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;
Signature · 1 line
2.31.1
maintainer Applied
#1 lore raw

2021-06-09 12:48 GMT+09:00, Chen Li <[email protected]>:

Quoted 7 lines

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.

merged into #dev, Thanks for your patch!