From 9f1c440f928307f6e410f9219d67ce04843ccf01 Mon Sep 17 00:00:00 2001 From: Guangshuo Li Date: Wed, 16 Sep 2026 13:31:17 +0800 Subject: [PATCH] net: ionic: free VF resources on remove ionic_probe() allocates VF tracking data and maps a statistics buffer for each already enabled VF with ionic_vf_alloc(). The probe failure path releases these resources with ionic_vf_dealloc(). However, after a successful probe, ionic_remove() tears down the LIF and device without releasing the VF resources. This leaves the VF tracking allocation and statistics DMA mappings behind when the PF driver is removed. Call ionic_vf_dealloc() before deinitializing the LIF so the VF statistics addresses can be cleared and the associated DMA mappings and tracking data released. This issue was found by manual code inspection. Cc: stable+noautosel@kernel.org # untested fix to a driver init path Signed-off-by: Guangshuo Li Link: https://patch.msgid.link/20260916053117.2906446-1-lgs201920130244@gmail.com Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index 05f19489ec5c..666efe972de7 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -424,6 +424,7 @@ static void ionic_remove(struct pci_dev *pdev) ionic_auxbus_unregister(ionic->lif); ionic_lif_unregister(ionic->lif); ionic_devlink_unregister(ionic); + ionic_vf_dealloc(ionic); ionic_lif_deinit(ionic->lif); ionic_lif_free(ionic->lif); ionic->lif = NULL;