linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Dejin Zheng <zhengdejin5@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: Mon, 27 Apr 2020 13:40:02 +0300	[thread overview]
Message-ID: <CAHp75VeAetsZsANoHx7X-g8+LOt0+NNarXheY5AR6L+LrdHavQ@mail.gmail.com> (raw)
In-Reply-To: <20200425134007.15843-1-zhengdejin5@gmail.com>

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.

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2020-04-27 10:40 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 [this message]
2020-04-28  3:12   ` 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=CAHp75VeAetsZsANoHx7X-g8+LOt0+NNarXheY5AR6L+LrdHavQ@mail.gmail.com \
    --to=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 \
    --cc=zhengdejin5@gmail.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;
as well as URLs for NNTP newsgroup(s).