* [PATCH] PCI/MSI: Fix msi_desc->affinity memory leak when freeing MSI IRQs.
@ 2017-02-02 14:26 Prarit Bhargava
0 siblings, 0 replies; only message in thread
From: Prarit Bhargava @ 2017-02-02 14:26 UTC (permalink / raw)
To: linux-pci; +Cc: Prarit Bhargava, mstowe, Bjorn Helgaas
During device setup, msix_setup_entries() and msi_setup_entry() allocate
msi_desc by calling alloc_msi_entry(). alloc_msi_entry() can also allocate a
affinity cpumask. During device teardown free_msi_irqs() is called and the
msi_desc is freed, but the affinity cpumask is leaked.
Fix it by calling free_msi_entry() which frees both the msi_desc and the
affinity cpumask.
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: mstowe@redhat.com
Cc: Bjorn Helgaas <bhelgaas@google.com>
---
drivers/pci/msi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 50c5003295ca..3d709311052d 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -379,7 +379,7 @@ static void free_msi_irqs(struct pci_dev *dev)
}
list_del(&entry->list);
- kfree(entry);
+ free_msi_entry(entry);
}
if (dev->msi_irq_groups) {
--
1.7.9.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-02-02 14:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-02 14:26 [PATCH] PCI/MSI: Fix msi_desc->affinity memory leak when freeing MSI IRQs Prarit Bhargava
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).