lkml.org 
[lkml]   [2020]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH net v1] net: acenic: fix an issue about leak related system resources
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

\
 
 \ /
  Last update: 2020-04-27 12:40    [W:0.045 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site