linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] exfat: avoid incorrectly releasing for root inode
@ 2021-06-09  3:48 Chen Li
  2021-06-12  0:57 ` Namjae Jeon
  0 siblings, 1 reply; 2+ messages in thread
From: Chen Li @ 2021-06-09  3:48 UTC (permalink / raw)
  To: linux-fsdevel, linux-kernel, Sungjong Seo, Namjae Jeon


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(-)

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;
-- 
2.31.1




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] exfat: avoid incorrectly releasing for root inode
  2021-06-09  3:48 [PATCH] exfat: avoid incorrectly releasing for root inode Chen Li
@ 2021-06-12  0:57 ` Namjae Jeon
  0 siblings, 0 replies; 2+ messages in thread
From: Namjae Jeon @ 2021-06-12  0:57 UTC (permalink / raw)
  To: Chen Li; +Cc: linux-fsdevel, linux-kernel, Sungjong Seo, Namjae Jeon

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!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-12  0:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09  3:48 [PATCH] exfat: avoid incorrectly releasing for root inode Chen Li
2021-06-12  0:57 ` Namjae Jeon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).