Skip to content

Commit 018359b

Browse files
shuv-ampgregkh
authored andcommitted
PCI: meson: Propagate devm_add_action_or_reset() failure
[ Upstream commit b12341b ] meson_pcie_probe_clock() enables a clock and then registers a devres action to disable it during teardown. If devm_add_action_or_reset() fails, it runs the action immediately, disabling the clock. The return value is currently ignored, so on that failure path, meson_pcie_probe_clock() returns the disabled clock and probe continues. Return the error so the existing probe error path unwinds normally. Fixes: 9c0ef6d ("PCI: amlogic: Add the Amlogic Meson PCIe controller driver") Signed-off-by: Shuvam Pandey <shuvampandey1@gmail.com> Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patch.msgid.link/177909148011.9588.6639767953842842291@gmail.com Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent b0c5bc5 commit 018359b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/pci/controller/dwc/pci-meson.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ static inline struct clk *meson_pcie_probe_clock(struct device *dev,
194194
return ERR_PTR(ret);
195195
}
196196

197-
devm_add_action_or_reset(dev, meson_pcie_disable_clock, clk);
197+
ret = devm_add_action_or_reset(dev, meson_pcie_disable_clock, clk);
198+
if (ret)
199+
return ERR_PTR(ret);
198200

199201
return clk;
200202
}

0 commit comments

Comments
 (0)