android_kernel_xiaomi_sm8350/drivers/pci/hotplug
Jesper Juhl b91aac29bb PCI Hotplug: Fix small mem leak in IBM Hot Plug Controller Driver
In drivers/pci/hotplug/ibmphp_ebda.c::ebda_rsrc_controller(), storage is
allocated with kzalloc() and assigned to 'tmp_slot'.  Then lots of
stuff, like ->flag, ->supported_speed etc is set in tmp_slot.  A bit
further down there's then this test :

  if (!bus_info_ptr1) {
    rc = -ENODEV;
    goto error;
  }

At this point, tmp_slot has not been assigned to anything, so when
erroring-out we want to free it, but nothing at the 'error:' label
free's 'tmp_slot' - and we can't really free 'tmp_slot' at 'error:'
since we may jump to that label later when 'tmp_slot' *has* been used
and we do not want it freed. So, the only sane option left seems to be
to kfree(tmp_slot) just before jumping to the 'error:' label in the one
place where this is what actually makes sense. The following patch does
just that and thus kills off a tiny potential memory leak.


Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-03-10 16:38:02 -07:00
..
acpi_pcihp.c
acpiphp_core.c PCI: don't load acpi_php when acpi is disabled 2008-02-21 15:34:37 -08:00
acpiphp_glue.c PCI: fix section mismatch warning in pci_scan_child_bus 2008-03-04 15:07:03 -08:00
acpiphp_ibm.c PCI: hotplug: acpiphp_ibm: Remove get device information 2008-02-21 15:34:35 -08:00
acpiphp.h PCI: hotplug: acpiphp: Remove unused variable from acpiphp 2008-02-01 15:04:20 -08:00
cpci_hotplug_core.c
cpci_hotplug_pci.c PCI: fix section mismatch warning in pci_scan_child_bus 2008-03-04 15:07:03 -08:00
cpci_hotplug.h
cpcihp_generic.c
cpcihp_zt5550.c
cpcihp_zt5550.h
cpqphp_core.c
cpqphp_ctrl.c
cpqphp_nvram.c
cpqphp_nvram.h
cpqphp_pci.c
cpqphp_sysfs.c
cpqphp.h
fakephp.c PCI: Fix fakephp deadlock 2008-02-01 15:04:30 -08:00
ibmphp_core.c PCI: hotplug: Switch to pci_get_bus_and_slot 2008-02-01 15:04:19 -08:00
ibmphp_ebda.c PCI Hotplug: Fix small mem leak in IBM Hot Plug Controller Driver 2008-03-10 16:38:02 -07:00
ibmphp_hpc.c
ibmphp_pci.c
ibmphp_res.c
ibmphp.h
Kconfig PCI: hotplug: remove Experimental 2008-02-01 15:04:19 -08:00
Makefile PCI: hotplug: Link fakephp last 2008-02-01 15:04:20 -08:00
pci_hotplug_core.c PCI: Add missing "space" in printk messages 2008-02-01 15:04:22 -08:00
pciehp_core.c PCI Hotplug: pciehp: remove needless members from struct controller 2008-02-01 15:04:24 -08:00
pciehp_ctrl.c pciehp: wait for 1000ms before LED operation after power off 2008-02-01 15:04:28 -08:00
pciehp_hpc.c pci: hotplug: pciehp: fix error code path in hpc_power_off_slot 2008-03-04 15:07:04 -08:00
pciehp_pci.c PCI: fix section mismatch warning in pci_scan_child_bus 2008-03-04 15:07:03 -08:00
pciehp.h PCI Hotplug: pciehp: remove needless members from struct controller 2008-02-01 15:04:24 -08:00
pcihp_skeleton.c
rpadlpar_core.c
rpadlpar_sysfs.c Kobject: convert drivers/* from kobject_unregister() to kobject_put() 2008-01-24 20:40:40 -08:00
rpadlpar.h
rpaphp_core.c
rpaphp_pci.c pci hotplug: fix rpaphp directory naming 2008-02-01 15:04:22 -08:00
rpaphp_slot.c pci hotplug: fix rpaphp directory naming 2008-02-01 15:04:22 -08:00
rpaphp.h pci hotplug: fix rpaphp directory naming 2008-02-01 15:04:22 -08:00
sgi_hotplug.c
shpchp_core.c
shpchp_ctrl.c
shpchp_hpc.c PCI: Spelling fixes 2008-02-01 15:04:26 -08:00
shpchp_pci.c PCI: fix section mismatch warning in pci_scan_child_bus 2008-03-04 15:07:03 -08:00
shpchp_sysfs.c
shpchp.h