public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Dejin Zheng <zhengdejin5@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	jes@trained-monkey.org, linux-acenic@sunsite.dk,
	netdev <netdev@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net v1] net: acenic: fix an issue about leak related system resources
Date: Tue, 28 Apr 2020 11:12:47 +0800	[thread overview]
Message-ID: <20200428031247.GB31933@nuc8i5> (raw)
In-Reply-To: <CAHp75VeAetsZsANoHx7X-g8+LOt0+NNarXheY5AR6L+LrdHavQ@mail.gmail.com>

On Mon, Apr 27, 2020 at 01:40:02PM +0300, Andy Shevchenko wrote:
> On Sat, Apr 25, 2020 at 4:40 PM Dejin Zheng <zhengdejin5@gmail.com> wrote:
> >
> > the function ace_allocate_descriptors() and ace_init() can fail in
> > the acenic_probe_one(), The related system resources were not
> > released then. so change the error handling to fix it.
> 
> ...
> 
> > @@ -568,7 +568,7 @@ static int acenic_probe_one(struct pci_dev *pdev,
> >  #endif
> >
> >         if (ace_allocate_descriptors(dev))
> > -               goto fail_free_netdev;
> > +               goto fail_uninit;
> 
> Not sure.
> The code is quite old and requires a lot of refactoring.
> 
> Briefly looking the error path there is quite twisted.
>
> > @@ -580,7 +580,7 @@ static int acenic_probe_one(struct pci_dev *pdev,
> >  #endif
> >
> >         if (ace_init(dev))
> > -               goto fail_free_netdev;
> > +               goto fail_uninit;
> 
> This change seems incorrect, the ace_init() calls ace_init_cleanup() on error.
> So, your change makes it call the cleanup() twice.
> 
Hi Andy:

Yes, this code is quite old, and There are also some mistakes in my
patch, abandon this commit first. Thanks!

BR,
Dejin
> -- 
> With Best Regards,
> Andy Shevchenko

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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-25 13:40 [PATCH net v1] net: acenic: fix an issue about leak related system resources Dejin Zheng
2020-04-27 10:40 ` Andy Shevchenko
2020-04-28  3:12   ` Dejin Zheng [this message]

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=20200428031247.GB31933@nuc8i5 \
    --to=zhengdejin5@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=davem@davemloft.net \
    --cc=jes@trained-monkey.org \
    --cc=linux-acenic@sunsite.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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