PCI: Clean up resource allocation in devm_of_pci_get_host_bridge_resources()
Instead of first allocating and then freeing memory for struct resource in case we cannot parse a PCI resource from the device tree, work against a local struct and kmemdup() it when we decide to go with it. Suggested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com> Signed-off-by: NBjorn Helgaas <bhelgaas@google.com> Reviewed-by: NVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Showing
想要评论请 注册 或 登录