Linux-Fsdevel Archive on
help / color / mirror / Atom feed
From: Wei Yongjun <>
To: Namjae Jeon <>,
	Sungjong Seo <>
Cc: Wei Yongjun <>,
Subject: [PATCH -next] exfat: fix possible memory leak in exfat_find()
Date: Wed, 6 May 2020 14:25:54 +0000	[thread overview]
Message-ID: <> (raw)

'es' is malloced from exfat_get_dentry_set() in exfat_find() and should
be freed before leaving from the error handling cases, otherwise it will
cause memory leak.

Fixes: 5f2aa075070c ("exfat: add inode operations")
Signed-off-by: Wei Yongjun <>
 fs/exfat/namei.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c
index c241dd177f1a..48f4df883f3b 100644
--- a/fs/exfat/namei.c
+++ b/fs/exfat/namei.c
@@ -681,6 +681,7 @@ static int exfat_find(struct inode *dir, struct qstr *qname,
 				"non-zero size file starts with zero cluster (size : %llu, p_dir : %u, entry : 0x%08x)",
 				i_size_read(dir), ei->dir.dir, ei->entry);
+			kfree(es);
 			return -EIO;

             reply	other threads:[~2020-05-06 14:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <>
2020-05-06 14:25 ` Wei Yongjun [this message]
2020-05-07  2:50   ` Namjae Jeon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \
    --subject='Re: [PATCH -next] exfat: fix possible memory leak in exfat_find()' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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