Skip to content

Commit

Permalink
linux/ena: Fix PHC info release timing
Browse files Browse the repository at this point in the history
As PHC info is a part of the adapter struct and since the adapter
struct is also a part of the netdev private area [1],
PHC info must be released before releasing netdev.

[1]: https://elixir.bootlin.com/linux/v6.7/source/net/core/dev.c#L10778

Fixes: 2e9a716 ("linux/ena: Move PHC info struct allocation")
Signed-off-by: Amit Bernstein <amitbern@amazon.com>
  • Loading branch information
davidarinzon committed Feb 7, 2024
1 parent c8811f7 commit f391b6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/linux/ena/ena_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -4914,6 +4914,8 @@ static void __ena_shutoff(struct pci_dev *pdev, bool shutdown)
adapter->reset_reason = ENA_REGS_RESET_SHUTDOWN;
ena_destroy_device(adapter, true);

ena_phc_free(adapter);

if (shutdown) {
netif_device_detach(netdev);
dev_close(netdev);
Expand All @@ -4932,8 +4934,6 @@ static void __ena_shutoff(struct pci_dev *pdev, bool shutdown)

ena_com_delete_customer_metrics_buffer(ena_dev);

ena_phc_free(adapter);

ena_release_bars(ena_dev, pdev);

pci_disable_device(pdev);
Expand Down

0 comments on commit f391b6c

Please sign in to comment.