PCI: Fix refcount issue in pci_create_root_bus() error recovery path
authorJiang Liu <liuj97@gmail.com>
Thu, 6 Jun 2013 17:10:08 +0000 (01:10 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Jul 2013 00:16:08 +0000 (17:16 -0700)
commit7fe6b2b4994fcdede2274c23ad0886f2cb3549f3
tree2fe627023f7dcac283367b54233933b464173436
parent1eadb07a8d01b5c2ae323cef29276440627fc7f1
PCI: Fix refcount issue in pci_create_root_bus() error recovery path

commit 343df771e671d821478dd3ef525a0610b808dbf8 upstream.

After calling device_register(&bridge->dev), the bridge is reference-
counted, and it is illegal to call kfree() on it except in the release
function.

[bhelgaas: changelog, use put_device() after device_register() failure]
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/probe.c