Message ID | 20230716124740.4777-1-ruc_gongyuanjun@163.com (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Krzysztof WilczyĆski |
Headers | show |
Series | [1/1] pci: add a return value check | expand |
diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c index c1527693bed9..8b8a2df4ee62 100644 --- a/drivers/pci/controller/dwc/pci-meson.c +++ b/drivers/pci/controller/dwc/pci-meson.c @@ -187,9 +187,11 @@ static inline struct clk *meson_pcie_probe_clock(struct device *dev, return ERR_PTR(ret); } - devm_add_action_or_reset(dev, + ret = devm_add_action_or_reset(dev, (void (*) (void *))clk_disable_unprepare, clk); + if (ret) + return ERR_PTR(ret); return clk; }
devm_add_action_or_reset() may fail, therefore, a check to the return value of devm_add_action_or_reset() is added before return. Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com> --- drivers/pci/controller/dwc/pci-meson.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)