public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Dejin Zheng <zhengdejin5@gmail.com>
To: Yash Shah <yash.shah@sifive.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	"palmer@dabbelt.com" <palmer@dabbelt.com>,
	"nicolas.ferre@microchip.com" <nicolas.ferre@microchip.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: Re: [PATCH net v1] net: macb: fix an issue about leak related system resources
Date: Tue, 28 Apr 2020 11:25:51 +0800	[thread overview]
Message-ID: <20200428032551.GB32072@nuc8i5> (raw)
In-Reply-To: <MN2PR13MB355263F89012F7D742DAE5FA8CAF0@MN2PR13MB3552.namprd13.prod.outlook.com>

On Mon, Apr 27, 2020 at 08:25:41AM +0000, Yash Shah wrote:
> > -----Original Message-----
> > From: Dejin Zheng <zhengdejin5@gmail.com>
> > Sent: 25 April 2020 18:28
> > To: davem@davemloft.net; Paul Walmsley <paul.walmsley@sifive.com>;
> > palmer@dabbelt.com; nicolas.ferre@microchip.com; Yash Shah
> > <yash.shah@sifive.com>; netdev@vger.kernel.org
> > Cc: linux-kernel@vger.kernel.org; Dejin Zheng <zhengdejin5@gmail.com>;
> > Andy Shevchenko <andy.shevchenko@gmail.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@gmail.com>
> > Signed-off-by: Dejin Zheng <zhengdejin5@gmail.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@sifive.com>
>
Thanks Yash!

> - Yash
> 

  reply	other threads:[~2020-04-28  3:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-25 12:57 [PATCH net v1] net: macb: fix an issue about leak related system resources Dejin Zheng
2020-04-27  8:25 ` Yash Shah
2020-04-28  3:25   ` Dejin Zheng [this message]
2020-04-27 10:33 ` Andy Shevchenko
2020-04-28  3:24   ` Dejin Zheng
2020-04-28  8:42     ` Nicolas Ferre
2020-04-28 13:11       ` Dejin Zheng
2020-04-28 14:04         ` Andy Shevchenko
2020-04-28 14:52           ` Dejin Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200428032551.GB32072@nuc8i5 \
    --to=zhengdejin5@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=yash.shah@sifive.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox