Commit 6383447
ixgbe: fix memory leaks in the ixgbe_recovery_probe() path
When ixgbe_recovery_probe() is invoked and this function fails,
allocated resources in advance are not completely freed, because
ixgbe_probe() returns ixgbe_recovery_probe() directly and
ixgbe_recovery_probe() only frees partial resources, resulting in memory
leaks including:
- adapter->io_addr
- adapter->jump_tables[0]
- adapter->mac_table
- adapter->rss_key
- adapter->af_xdp_zc_qps
The leaked MMIO region can be observed in /proc/vmallocinfo, and the
remaining leaks are reported by kmemleak.
Don't return ixgbe_recovery_probe() directly, and instead let
ixgbe_probe() to clean up resources on failures.
Fixes: 29cb3b8 ("ixgbe: add E610 implementation of FW recovery mode")
Signed-off-by: Kohei Enju <enjuk@amazon.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>1 parent e9acda5 commit 6383447
1 file changed
Lines changed: 8 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11468 | 11468 | | |
11469 | 11469 | | |
11470 | 11470 | | |
11471 | | - | |
11472 | 11471 | | |
11473 | 11472 | | |
11474 | | - | |
11475 | 11473 | | |
11476 | 11474 | | |
11477 | 11475 | | |
11478 | | - | |
| 11476 | + | |
11479 | 11477 | | |
11480 | 11478 | | |
11481 | 11479 | | |
| |||
11507 | 11505 | | |
11508 | 11506 | | |
11509 | 11507 | | |
11510 | | - | |
11511 | | - | |
11512 | | - | |
11513 | | - | |
11514 | | - | |
11515 | | - | |
11516 | | - | |
11517 | 11508 | | |
11518 | 11509 | | |
11519 | 11510 | | |
| |||
11655 | 11646 | | |
11656 | 11647 | | |
11657 | 11648 | | |
11658 | | - | |
11659 | | - | |
| 11649 | + | |
| 11650 | + | |
| 11651 | + | |
| 11652 | + | |
| 11653 | + | |
| 11654 | + | |
| 11655 | + | |
11660 | 11656 | | |
11661 | 11657 | | |
11662 | 11658 | | |
| |||
0 commit comments