Re: [PATCH v2 4/5] PCI: pciehp: Check pci_hp_add_bridge() return value
From: Lukas Wunner
Date: Wed Sep 09 2026 - 02:44:42 EST
On Tue, Sep 08, 2026 at 08:22:25PM -0600, Fahmy Hassan wrote:
> pciehp_configure_device() calls pci_hp_add_bridge() for each bridge on
> the newly added slot without checking its return value.
> pci_hp_add_bridge() already logs an error for one failure path (no
> bus number available for the hot-added bridge), but returns silently
> if the bridge's subordinate bus isn't created after scanning -- that
> path goes completely unreported, and either way the caller currently
> has no way to notice or react to the failure.
>
> Log an error via the driver's existing ctrl_err() macro when
> pci_hp_add_bridge() fails, identifying the device involved.
The only change here is to log something on error. That can be done
in pci_hp_add_bridge() itself without having to amend every caller.
However pci_hp_add_bridge() already logs an error for the one failure
case that merits an error message.
The return value is normally evaluated to do something, such as
bailing out or unwinding some earlier actions. But in this case,
I'm not seeing a need to do that.
So I believe this change isn't necessary, at least as far as pciehp
is concerned.
Thanks,
Lukas