lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAhV-H4jW3cJbtoL1gMZ=i7zy1fc4A4q0DqMYPQ-fGc7aHMmog@mail.gmail.com>
Date:   Mon, 6 Mar 2023 11:01:14 +0800
From:   Huacai Chen <chenhuacai@...nel.org>
To:     Dongliang Mu <dzm91@...t.edu.cn>
Cc:     Yinbo Zhu <zhuyinbo@...ngson.cn>, loongarch@...ts.linux.dev,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] drivers: loongson: fix memory leak in loongson2_guts_probe

Reviewed-by: Huacai Chen <chenhuacai@...ngson.cn>

On Mon, Mar 6, 2023 at 10:55 AM Dongliang Mu <dzm91@...t.edu.cn> wrote:
>
> drivers/soc/loongson/loongson2_guts.c:150 loongson2_guts_probe()
> warn: 'guts->regs' from ioremap() not released on lines: 131,135,139,143.
>
> Fix this by modifying ioremap to devm_ioremap.
>
> Note that, this patch is not tested due to the loongson architecture.
>
> Signed-off-by: Dongliang Mu <dzm91@...t.edu.cn>
> ---
> v1->v2: instead of modifying error handling code, directly change
> ioremap to devm_ioremap.
>  drivers/soc/loongson/loongson2_guts.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/soc/loongson/loongson2_guts.c b/drivers/soc/loongson/loongson2_guts.c
> index bace4bc8e03b..a053e3fdae09 100644
> --- a/drivers/soc/loongson/loongson2_guts.c
> +++ b/drivers/soc/loongson/loongson2_guts.c
> @@ -107,7 +107,7 @@ static int loongson2_guts_probe(struct platform_device *pdev)
>         guts->little_endian = of_property_read_bool(np, "little-endian");
>
>         res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       guts->regs = ioremap(res->start, res->end - res->start + 1);
> +       guts->regs = devm_ioremap(dev, res->start, res->end - res->start + 1);
>         if (IS_ERR(guts->regs))
>                 return PTR_ERR(guts->regs);
>
> --
> 2.39.2
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ