lkml.org 
[lkml]   [2022]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] PCI: amlogic: The check for devm_add_action_or_reset's return value added
Date
The return value of the function devm_add_action_or_reset() was not
checked hence an error code would not be returned.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 9c0ef6d34fdb ("PCI: amlogic: Add the Amlogic Meson PCIe controller driver")
Signed-off-by: Aleksandr Burakov <a.burakov@rosalinux.ru>
---
drivers/pci/controller/dwc/pci-meson.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c
index c1527693bed9..3d82f0b65480 100644
--- a/drivers/pci/controller/dwc/pci-meson.c
+++ b/drivers/pci/controller/dwc/pci-meson.c
@@ -187,9 +187,13 @@ 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) {
+ dev_err(dev, "couldn't reset clk\n");
+ return ERR_PTR(ret);
+ }

return clk;
}
--
2.25.1
\
 
 \ /
  Last update: 2023-03-26 23:15    [W:0.038 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site