]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
PCI/IOV: Fix memory leak in pci_iov_add_virtfn()
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Mon, 25 Nov 2019 19:52:52 +0000 (13:52 -0600)
committerPaolo Pisati <paolo.pisati@canonical.com>
Mon, 17 Feb 2020 11:36:57 +0000 (12:36 +0100)
commitbddc81d9f3ac823a1181a0c1f6b7eb69c325cb62
treed4bb03478158d02d674e42a5ba1b01c8bb146a15
parentf01c9f290fba98c6e794d35e75ad14d73dc9fe7d
PCI/IOV: Fix memory leak in pci_iov_add_virtfn()

BugLink: https://bugs.launchpad.net/bugs/1863589
commit 8c386cc817878588195dde38e919aa6ba9409d58 upstream.

In the implementation of pci_iov_add_virtfn() the allocated virtfn is
leaked if pci_setup_device() fails. The error handling is not calling
pci_stop_and_remove_bus_device(). Change the goto label to failed2.

Fixes: 156c55325d30 ("PCI: Check for pci_setup_device() failure in pci_iov_add_virtfn()")
Link: https://lore.kernel.org/r/20191125195255.23740-1-navid.emamdoost@gmail.com
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/pci/iov.c