[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9fa5857d-4d3f-4406-8241-20905bcfcc7f@redhat.com>
Date: Wed, 6 Nov 2024 12:59:14 -0600
From: Eric Sandeen <sandeen@...hat.com>
To: Hao Ge <hao.ge@...ux.dev>, jack@...e.cz
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
Hao Ge <gehao@...inos.cn>
Subject: Re: [PATCH] isofs: avoid memory leak in iocharset
On 11/6/24 2:28 AM, Hao Ge wrote:
> From: Hao Ge <gehao@...inos.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@...inos.cn>
Agreed, thank you.
Reviewed-by: Eric Sandeen <sandeen@...hat.com>
Powered by blists - more mailing lists