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]
Date: Mon, 18 Dec 2023 12:57:07 +0300
From: Karina Yankevich <k.yankevich@....ru>
To: Liam Girdwood <lgirdwood@...il.com>
CC: Karina Yankevich <k.yankevich@....ru>, Mark Brown <broonie@...nel.org>,
	<linux-kernel@...r.kernel.org>, <lvc-project@...uxtesting.org>
Subject: [PATCH] regulator: of: Remove redundant check in of_get_regulation_constraints

The pointer 'suspend_state' cannot be NULL after the switch statement
so remove the redundant check.

Found by Linux Verification Center (linuxtesting.org) with the Svace static
analysis tool.

Signed-off-by: Karina Yankevich <k.yankevich@....ru>
---
 drivers/regulator/of_regulator.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index 1b65e5e4e40f..c926779523ca 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -266,10 +266,6 @@ static int of_get_regulation_constraints(struct device *dev,
 		suspend_np = of_get_child_by_name(np, regulator_states[i]);
 		if (!suspend_np)
 			continue;
-		if (!suspend_state) {
-			of_node_put(suspend_np);
-			continue;
-		}
 
 		if (!of_property_read_u32(suspend_np, "regulator-mode",
 					  &pval)) {
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ