Commit 99a0efba authored by Jim Quinlan's avatar Jim Quinlan Committed by Greg Kroah-Hartman
Browse files

PCI: brcmstb: Fix error path after a call to regulator_bulk_get()



[ Upstream commit 3651ad52 ]

If the regulator_bulk_get() returns an error and no regulators
are created, we need to set their number to zero.

If we don't do this and the PCIe link up fails, a call to the
regulator_bulk_free() will result in a kernel panic.

While at it, print the error value, as we cannot return an error
upwards as the kernel will WARN() on an error from add_bus().

Fixes: 9e6be018 ("PCI: brcmstb: Enable child bus device regulators from DT")
Signed-off-by: default avatarJim Quinlan <james.quinlan@broadcom.com>
Reviewed-by: default avatarFlorian Fainelli <florian.fainelli@broadcom.com>
Link: https://lore.kernel.org/r/20250214173944.47506-5-james.quinlan@broadcom.com


[kwilczynski: commit log, use comma in the message to match style with
other similar messages]
Signed-off-by: default avatarKrzysztof Wilczyński <kwilczynski@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 5bb237a1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment