From: Prarit Bhargava <prarit@redhat.com>
To: linux-pci@vger.kernel.org
Cc: Prarit Bhargava <prarit@redhat.com>,
mstowe@redhat.com, Bjorn Helgaas <bhelgaas@google.com>
Subject: [RESENT PATCH] PCI/MSI: Fix msi_desc->affinity memory leak when freeing MSI IRQs.
Date: Wed, 15 Feb 2017 11:53:08 -0500 [thread overview]
Message-ID: <1487177588-31369-1-git-send-email-prarit@redhat.com> (raw)
No response ... trying again.
P.
---8<---
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
next reply other threads:[~2017-02-15 16:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-15 16:53 Prarit Bhargava [this message]
2017-02-15 23:56 ` [RESENT PATCH] PCI/MSI: Fix msi_desc->affinity memory leak when freeing MSI IRQs Bjorn Helgaas
2017-02-16 12:47 ` Prarit Bhargava
2017-02-17 21:47 ` Bjorn Helgaas
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=1487177588-31369-1-git-send-email-prarit@redhat.com \
--to=prarit@redhat.com \
--cc=bhelgaas@google.com \
--cc=linux-pci@vger.kernel.org \
--cc=mstowe@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).