[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200428032551.GB32072@nuc8i5>
Date: Tue, 28 Apr 2020 11:25:51 +0800
From: Dejin Zheng <zhengdejin5@...il.com>
To: Yash Shah <yash.shah@...ive.com>
Cc: "davem@...emloft.net" <davem@...emloft.net>,
Paul Walmsley <paul.walmsley@...ive.com>,
"palmer@...belt.com" <palmer@...belt.com>,
"nicolas.ferre@...rochip.com" <nicolas.ferre@...rochip.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andy Shevchenko <andy.shevchenko@...il.com>
Subject: Re: [PATCH net v1] net: macb: fix an issue about leak related system
resources
On Mon, Apr 27, 2020 at 08:25:41AM +0000, Yash Shah wrote:
> > -----Original Message-----
> > From: Dejin Zheng <zhengdejin5@...il.com>
> > Sent: 25 April 2020 18:28
> > To: davem@...emloft.net; Paul Walmsley <paul.walmsley@...ive.com>;
> > palmer@...belt.com; nicolas.ferre@...rochip.com; Yash Shah
> > <yash.shah@...ive.com>; netdev@...r.kernel.org
> > Cc: linux-kernel@...r.kernel.org; Dejin Zheng <zhengdejin5@...il.com>;
> > Andy Shevchenko <andy.shevchenko@...il.com>
> > Subject: [PATCH net v1] net: macb: fix an issue about leak related system
> > resources
> >
> > [External Email] Do not click links or attachments unless you recognize the
> > sender and know the content is safe
> >
> > 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.
> >
> > 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
>
> The change looks good to me.
> Reviewed-by: Yash Shah <yash.shah@...ive.com>
>
Thanks Yash!
> - Yash
>
Powered by blists - more mailing lists