From: Guangshuo Li <lgs201920130244@gmail.com>
To: Brett Creeley <brett.creeley@amd.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Thomas Gleixner <tglx@kernel.org>, Kees Cook <kees@kernel.org>,
Takashi Iwai <tiwai@suse.de>,
Vivian Wang <wangruikang@iscas.ac.cn>,
Guangshuo Li <lgs201920130244@gmail.com>,
Shannon Nelson <sln@onemain.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: [PATCH] net: ionic: free VF resources on remove
Date: Wed, 16 Sep 2026 13:31:17 +0800 [thread overview]
Message-ID: <20260916053117.2906446-1-lgs201920130244@gmail.com> (raw)
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.
Fixes: fbb39807e9ae ("ionic: support sr-iov operations")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
---
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;
--
2.43.0
next reply other threads:[~2026-09-16 5:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 5:31 Guangshuo Li [this message]
2026-09-17 20:33 ` [PATCH] net: ionic: free VF resources on remove netdev-bot+sashiko
2026-09-19 0:10 ` patchwork-bot+netdevbpf
2026-09-21 18:58 ` Creeley, Brett
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260916053117.2906446-1-lgs201920130244@gmail.com \
--to=lgs201920130244@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=brett.creeley@amd.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kees@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sln@onemain.com \
--cc=stable@vger.kernel.org \
--cc=tglx@kernel.org \
--cc=tiwai@suse.de \
--cc=wangruikang@iscas.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox