[PATCH] virtio: vdpa: fix kernel warning in snet_vdpa_remove_vf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Call pci_free_irq_vectors after calling vdpa_unregister_device.
Otherwise, we get the following kernel warning:

	remove_proc_entry: removing non-empty directory 'irq/..',
	leaking at least '..'

This happens only if SNET_CFG_FLAG_IRQ_PF flag is not set.

This patch should be applied on top of:
virtio: vdpa: new SolidNET DPU driver,
by Alvaro Karsz alvaro.karsz@xxxxxxxxxxxxx

Signed-off-by: Alvaro Karsz <alvaro.karsz@xxxxxxxxxxxxx>
---
 drivers/vdpa/solidrun/snet_main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/vdpa/solidrun/snet_main.c b/drivers/vdpa/solidrun/snet_main.c
index 9ceacf96de0..0c13ccde452 100644
--- a/drivers/vdpa/solidrun/snet_main.c
+++ b/drivers/vdpa/solidrun/snet_main.c
@@ -1073,12 +1073,11 @@ static void snet_vdpa_remove_vf(struct pci_dev *pdev)
 	struct snet *snet = pci_get_drvdata(pdev);
 	struct psnet *psnet = snet->psnet;
 
+	vdpa_unregister_device(&snet->vdpa);
+	snet_free_vqs(snet);
 	/* If IRQs are allocated from the VF, we should free the IRQs */
 	if (!PSNET_FLAG_ON(psnet, SNET_CFG_FLAG_IRQ_PF))
 		pci_free_irq_vectors(pdev);
-
-	vdpa_unregister_device(&snet->vdpa);
-	snet_free_vqs(snet);
 }
 
 static void snet_vdpa_remove(struct pci_dev *pdev)
-- 
2.32.0

_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization



[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux