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  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 27 Apr 2020 13:33:41 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Dejin Zheng <zhengdejin5@...il.com>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Palmer Dabbelt <palmer@...belt.com>,
        Nicolas Ferre <nicolas.ferre@...rochip.com>,
        yash.shah@...ive.com, netdev <netdev@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net v1] net: macb: fix an issue about leak related system resources

On Sat, Apr 25, 2020 at 3:57 PM Dejin Zheng <zhengdejin5@...il.com> wrote:
>
> A call of the function macb_init() can fail in the function
> fu540_c000_init. The related system resources were not released
> then. use devm_ioremap() to replace ioremap() for fix it.
>

Why not to go further and convert to use devm_platform_ioremap_resource()?

> Fixes: c218ad559020ff9 ("macb: Add support for SiFive FU540-C000")
> Cc: Andy Shevchenko <andy.shevchenko@...il.com>
> Signed-off-by: Dejin Zheng <zhengdejin5@...il.com>
> ---
>  drivers/net/ethernet/cadence/macb_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index a0e8c5bbabc0..edba2eb56231 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -4178,7 +4178,7 @@ static int fu540_c000_init(struct platform_device *pdev)
>         if (!res)
>                 return -ENODEV;
>
> -       mgmt->reg = ioremap(res->start, resource_size(res));
> +       mgmt->reg = devm_ioremap(&pdev->dev, res->start, resource_size(res));
>         if (!mgmt->reg)
>                 return -ENOMEM;
>
> --
> 2.25.0
>


-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists