Skip to content

Commit 91fdb30

Browse files
Jiawen Wukuba-moo
authored andcommitted
net: libwx: fix memory leak on msix entry
Since pci_free_irq_vectors() set pdev->msix_enabled as 0 in the calling of pci_msix_shutdown(), wx->msix_entries is never freed. Reordering the lines to fix the memory leak. Cc: stable@vger.kernel.org Fixes: 3f70318 ("net: libwx: Add irq flow functions") Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Link: https://lore.kernel.org/r/20231128095928.1083292-1-jiawenwu@trustnetic.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 9f74a3d commit 91fdb30

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • drivers/net/ethernet/wangxun/libwx

drivers/net/ethernet/wangxun/libwx/wx_lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1972,11 +1972,11 @@ void wx_reset_interrupt_capability(struct wx *wx)
19721972
if (!pdev->msi_enabled && !pdev->msix_enabled)
19731973
return;
19741974

1975-
pci_free_irq_vectors(wx->pdev);
19761975
if (pdev->msix_enabled) {
19771976
kfree(wx->msix_entries);
19781977
wx->msix_entries = NULL;
19791978
}
1979+
pci_free_irq_vectors(wx->pdev);
19801980
}
19811981
EXPORT_SYMBOL(wx_reset_interrupt_capability);
19821982

0 commit comments

Comments
 (0)