This reverts commit 804443c1f27883926de94c849d91f5b7d7d696e9.I think you missed some thing about device_register(). This patch is wrong.
The newly added logic incorrectly sets bus_registered to true even when
device_register returns an error, this is incorrect.
When device_register fails, there is no need to release the reference count,
and there are no direct error-handling operations following its execution.
Therefore, this patch is meaningless and should be reverted.
Fixes: 804443c1f278 ("PCI: Fix reference leak in pci_register_host_bridge()")
Signed-off-by: Xiangwei Li <liwei728@xxxxxxxxxx>
Signed-off-by: Xiongfeng Wang <wangxiongfeng2@xxxxxxxxxx>