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, 24 Apr 2023 10:57:37 +0800
From:   Yuchen Yang <u202114568@...t.edu.cn>
To:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Stephen Boyd <sboyd@...eaurora.org>
Cc:     hust-os-kernel-patches@...glegroups.com,
        Yuchen Yang <u202114568@...t.edu.cn>,
        Dongliang Mu <dzm91@...t.edu.cn>,
        Mark Brown <broonie@...nsource.wolfsonmicro.com>,
        Liam Girdwood <lrg@...mlogic.co.uk>,
        linux-kernel@...r.kernel.org
Subject: [PATCH] drivers: regulator: core: remove return value check of `rdev->debugfs`

Smatch complains that:
rdev_init_debugfs() warn: 'rdev->debugfs' is an error pointer or valid

According to the documentation of the debugfs_create_dir() function, 
there is no need to check the return value of this function.
Just delete the dead code.

Fixes: 247514344492 ("regulator: Remove ifdefs for debugfs code")
Fixes: 1130e5b3ff4a ("regulator: Add initial per-regulator debugfs support")
Signed-off-by: Yuchen Yang <u202114568@...t.edu.cn>
Reviewed-by: Dongliang Mu <dzm91@...t.edu.cn>
---
 drivers/regulator/core.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 4fcd36055b02..979ee043f7a1 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -5188,10 +5188,6 @@ static void rdev_init_debugfs(struct regulator_dev *rdev)
 	}
 
 	rdev->debugfs = debugfs_create_dir(rname, debugfs_root);
-	if (!rdev->debugfs) {
-		rdev_warn(rdev, "Failed to create debugfs directory\n");
-		return;
-	}
 
 	debugfs_create_u32("use_count", 0444, rdev->debugfs,
 			   &rdev->use_count);
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ