]> git.baikalelectronics.ru Git - kernel.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)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 28 Jan 2015 23:08:20 +0000 (17:08 -0600)
commit71804cddbf98e0db50e222719efa3b94c868e151
tree6f0a31e8a236f9278c15b40988f4ea23fbfdc496
parentc687bb41805a1238a38a086952014d5682516d9d
of/pci: Free resources on failure in of_pci_get_host_bridge_resources()

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: 234aab4e9f6f ("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>
drivers/of/of_pci.c