]> git.ipfire.org Git - people/ms/linux.git/commit
of/pci: Free resources on failure in of_pci_get_host_bridge_resources()
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tue, 27 Jan 2015 18:01:45 +0000 (18:01 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2015 13:11:11 +0000 (14:11 +0100)
commit2ac80c2fd4214e398b010ff52683924de81c88f5
treec631ac5464ebf19ce30b5977878fcf538dd05832
parent3d51da2c0217b18a1a408b1f8b1df1a9a2f6662f
of/pci: Free resources on failure in of_pci_get_host_bridge_resources()

commit d2be00c0fb5ae0794deffcdb0425cd5a8d823db0 upstream.

In the function of_pci_get_host_bridge_resources() if the parsing of ranges
fails, previously allocated resources inclusive of bus_range are not freed
and are not expected to be freed by the function caller on error return.

This patch fixes the issues by adding code that properly frees resources
and bus_range before exiting the function with an error return value.

Fixes: cbe4097f8ae6 ("of/pci: Add support for parsing PCI host bridge resources from DT")
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Liviu Dudau <liviu.dudau@arm.com>
CC: Arnd Bergmann <arnd@arndb.de>
CC: Rob Herring <robh+dt@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/of/of_pci.c