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:   Wed, 19 Apr 2023 18:03:03 +0800
From:   Zhengkang Huang <zkhuang@...t.edu.cn>
To:     Benson Leung <bleung@...omium.org>
Cc:     Zhengkang Huang <zkhuang@...t.edu.cn>,
        Dongliang Mu <dzm91@...t.edu.cn>,
        chrome-platform@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: [PATCH] platform: chrome: wilco_ec: remove return value check of debugfs_create_dir()

Smatch complains that:
wilco_ec_debugfs_probe() warn: 'debug_info->dir' is an error 
pointer or valid 

Debugfs checks are generally not supposed to be checked 
for errors and it is not necessary here. 

Just delete the dead code. 

Signed-off-by: Zhengkang Huang <zkhuang@...t.edu.cn>
Reviewed-by: Dongliang Mu <dzm91@...t.edu.cn>
---
NOTES: The issue is found by static analysis and remains untested.
---

 drivers/platform/chrome/wilco_ec/debugfs.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/platform/chrome/wilco_ec/debugfs.c b/drivers/platform/chrome/wilco_ec/debugfs.c
index a812788a0bdc..7a13f13b16cd 100644
--- a/drivers/platform/chrome/wilco_ec/debugfs.c
+++ b/drivers/platform/chrome/wilco_ec/debugfs.c
@@ -251,8 +251,6 @@ static int wilco_ec_debugfs_probe(struct platform_device *pdev)
 		return 0;
 	debug_info->ec = ec;
 	debug_info->dir = debugfs_create_dir("wilco_ec", NULL);
-	if (!debug_info->dir)
-		return 0;
 	debugfs_create_file("raw", 0644, debug_info->dir, NULL, &fops_raw);
 	debugfs_create_file("h1_gpio", 0444, debug_info->dir, ec,
 			    &fops_h1_gpio);
-- 
2.40.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ