[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdV5guFbo76nq27aZjWsYqneOfGNf0Ozyh0C53+VgnXgXw@mail.gmail.com>
Date: Fri, 31 Mar 2023 14:13:10 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Li Yang <lidaxian@...t.edu.cn>
Cc: Magnus Damm <magnus.damm@...il.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>,
Biju Das <biju.das.jz@...renesas.com>,
Dan Carpenter <error27@...il.com>,
linux-renesas-soc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] soc: renesas: renesas-soc: release 'chipid' from ioremap()
Hi Li,
On Fri, Mar 31, 2023 at 12:14 PM Li Yang <lidaxian@...t.edu.cn> wrote:
> Smatch reports:
>
> drivers/soc/renesas/renesas-soc.c:536 renesas_soc_init() warn:
> 'chipid' from ioremap() not released on lines: 475.
>
> If soc_dev_atrr allocation is failed, function renesas_soc_init()
> will return without releasing 'chipid' from ioremap().
>
> Fix this by adding function iounmap().
>
> Fixes: cb5508e47e60 ("soc: renesas: Add support for reading product revision for RZ/G2L family")
> Signed-off-by: Li Yang <lidaxian@...t.edu.cn>
> Reviewed-by: Dan Carpenter <error27@...il.com>
Thanks for your patch!
> --- a/drivers/soc/renesas/renesas-soc.c
> +++ b/drivers/soc/renesas/renesas-soc.c
> @@ -471,8 +471,11 @@ static int __init renesas_soc_init(void)
> }
>
> soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
> - if (!soc_dev_attr)
> + if (!soc_dev_attr) {
> + if (chipid)
> + iounmap(chipid);
We don't really care, as the system is dead at this point anyway.
> return -ENOMEM;
> + }
>
> np = of_find_node_by_path("/");
> of_property_read_string(np, "model", &soc_dev_attr->machine);
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists