diff options
| author | Eric Joyner <eric.joyner@amd.com> | 2026-10-15 16:03:31 -0700 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-10-21 17:10:54 -0700 |
| commit | 4e15e0a941ce901d51b5f203713fa90feee9c4d3 (patch) | |
| tree | 6d62faa56e06002c52799b89ba532643128e10fe /scripts/Makefile.thinlto | |
| parent | d90d1a768b3b022c52beafb3a4701ee2ee3d2b5e (diff) | |
| download | linux-4e15e0a941ce901d51b5f203713fa90feee9c4d3.tar.gz linux-4e15e0a941ce901d51b5f203713fa90feee9c4d3.zip | |
ionic: free port_info when probe fails after the port is set up
ionic_probe() allocates the port_info DMA buffer via ionic_setup_one()
-> ionic_port_init(). If probe then fails anywhere after that, it
unwinds through err_out_pci, which never calls ionic_port_reset();
ionic_dev_teardown() and ionic_clear_pci() do not touch port_info, and
so the buffer is leaked. The call was lost when the setup code was
moved into ionic_setup_one().
Since ionic_remove() already frees the port_info DMA buffer with
ionic_port_reset(), call that on the probe error path too. Every path
to err_out_pci runs after ionic_setup_one() succeeded, so the BARs are
still mapped and the firmware gets a PORT_RESET before the buffer is
freed, the same order as in ionic_remove().
Fixes: 0de38d9f1dba ("ionic: extract common bits from ionic_probe")
Signed-off-by: Eric Joyner <eric.joyner@amd.com>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Link: https://patch.msgid.link/20261015-ionic-port-info-lifetime-v2-2-57232013fd79@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
