mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: Hao Ge <hao.ge@linux.dev>, jack@suse.cz
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Hao Ge <gehao@kylinos.cn>
Subject: Re: [PATCH] isofs: avoid memory leak in iocharset
Date: Wed, 6 Nov 2024 12:59:14 -0600	[thread overview]
Message-ID: <9fa5857d-4d3f-4406-8241-20905bcfcc7f@redhat.com> (raw)
In-Reply-To: <20241106082841.51773-1-hao.ge@linux.dev>

On 11/6/24 2:28 AM, Hao Ge wrote:
> From: Hao Ge <gehao@kylinos.cn>

...

> The opt->iocharset is freed inside the isofs_fill_super function,
> But there may be situations where it's not possible to
> enter this function.
> 
> For example, in the get_tree_bdev_flags function,when
> encountering the situation where "Can't mount, would change RO state,"
> In such a case, isofs_fill_super will not have the opportunity
> to be called,which means that opt->iocharset will not have the chance
> to be freed,ultimately leading to a memory leak.
> 
> Let's move the memory freeing of opt->iocharset into
> isofs_free_fc function.
> 
> Fixes: 1b17a46c9243 ("isofs: convert isofs to use the new mount API")
> Signed-off-by: Hao Ge <gehao@kylinos.cn>

Agreed, thank you.

Reviewed-by: Eric Sandeen <sandeen@redhat.com>



      parent reply	other threads:[~2024-11-06 18:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-06  8:28 Hao Ge
2024-11-06 12:40 ` Jan Kara
2024-11-06 18:59 ` Eric Sandeen [this message]

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=9fa5857d-4d3f-4406-8241-20905bcfcc7f@redhat.com \
    --to=sandeen@redhat.com \
    --cc=gehao@kylinos.cn \
    --cc=hao.ge@linux.dev \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®