Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c0064e10 authored by Lorenzo Pieralisi's avatar Lorenzo Pieralisi Committed by Sasha Levin
Browse files

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: cbe4097f ("of/pci: Add support for parsing PCI host bridge resources from DT")
Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarLiviu Dudau <liviu.dudau@arm.com>
CC: Arnd Bergmann <arnd@arndb.de>
CC: Rob Herring <robh+dt@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f42e86dc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment