]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
x86/PCI: Fix PCI IRQ routing table memory leak
authorWenwen Wang <wang6495@umn.edu>
Wed, 17 Apr 2019 14:18:50 +0000 (09:18 -0500)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit32040016416fb1bda963691be8dc6d36bc7d3c45
tree54262834ee48c591a1c282c3285054a9bebdc6aa
parent657d8221119c5504390f630be2794e1dd286df0d
x86/PCI: Fix PCI IRQ routing table memory leak

BugLink: https://bugs.launchpad.net/bugs/1838824
[ Upstream commit ea094d53580f40c2124cef3d072b73b2425e7bfd ]

In pcibios_irq_init(), the PCI IRQ routing table 'pirq_table' is first
found through pirq_find_routing_table().  If the table is not found and
CONFIG_PCI_BIOS is defined, the table is then allocated in
pcibios_get_irq_routing_table() using kmalloc().  Later, if the I/O APIC is
used, this table is actually not used.  In that case, the allocated table
is not freed, which is a memory leak.

Free the allocated table if it is not used.

Signed-off-by: Wenwen Wang <wang6495@umn.edu>
[bhelgaas: added Ingo's reviewed-by, since the only change since v1 was to
use the irq_routing_table local variable name he suggested]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
arch/x86/pci/irq.c