lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240401103808.617463-1-aaprelkov@usergate.com>
Date: Mon, 1 Apr 2024 17:38:08 +0700
From: Aleksandr Aprelkov <aaprelkov@...rgate.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
CC: Aleksandr Aprelkov <aaprelkov@...rgate.com>,Michael Turquette <mturquette@...libre.com>,Stephen Boyd <sboyd@...nel.org>,<linux-kernel@...r.kernel.org>,<linux-samsung-soc@...r.kernel.org>,<linux-clk@...r.kernel.org>,<lvc-project@...uxtesting.org>
Subject: [PATCH] clk: s2mps11: Check of_clk_add_hw_provider() result

There is no check if error occurs in clock provider registration.

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

Fixes: b228fad50c00 ("clk: s2mps11: Migrate to clk_hw based OF and registration APIs")
Signed-off-by: Aleksandr Aprelkov <aaprelkov@...rgate.com>
---
 drivers/clk/clk-s2mps11.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
index 38c456540d1b..f9ce413b6c02 100644
--- a/drivers/clk/clk-s2mps11.c
+++ b/drivers/clk/clk-s2mps11.c
@@ -187,8 +187,10 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
 	}
 
 	clk_data->num = S2MPS11_CLKS_NUM;
-	of_clk_add_hw_provider(s2mps11_clks->clk_np, of_clk_hw_onecell_get,
+	ret = of_clk_add_hw_provider(s2mps11_clks->clk_np, of_clk_hw_onecell_get,
 			       clk_data);
+	if (ret < 0)
+		goto err_reg;
 
 	platform_set_drvdata(pdev, s2mps11_clks);
 
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ