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: <1632897629-84965-1-git-send-email-yang.lee@linux.alibaba.com>
Date:   Wed, 29 Sep 2021 14:40:29 +0800
From:   Yang Li <yang.lee@...ux.alibaba.com>
To:     tim@...erelk.net
Cc:     axboe@...nel.dk, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org, Yang Li <yang.lee@...ux.alibaba.com>
Subject: [PATCH -next] pcd: capture error codes on pcd_probe() and pf_probe()

No error code were being captured when pcd_probe() and
pf_probe() fail, capture them by assigning them to ret.

Clean up smatch warning:
drivers/block/paride/pcd.c:939 pcd_init_unit() warn: missing error code
'ret'
drivers/block/paride/pf.c:963 pf_init_unit() warn: missing error code
'ret'

Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@...ux.alibaba.com>
---
 drivers/block/paride/pcd.c | 3 ++-
 drivers/block/paride/pf.c  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c
index 4cc0d14..9ae8859 100644
--- a/drivers/block/paride/pcd.c
+++ b/drivers/block/paride/pcd.c
@@ -935,7 +935,8 @@ static int pcd_init_unit(struct pcd_unit *cd, bool autoprobe, int port,
 	if (!pi_init(cd->pi, autoprobe, port, mode, unit, protocol, delay,
 			pcd_buffer, PI_PCD, verbose, cd->name))
 		goto out_free_disk;
-	if (pcd_probe(cd, ms))
+	ret = pcd_probe(cd, ms);
+	if (ret)
 		goto out_pi_release;
 
 	cd->present = 1;
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c
index 380d80e..7b9acfc 100644
--- a/drivers/block/paride/pf.c
+++ b/drivers/block/paride/pf.c
@@ -959,7 +959,8 @@ static int __init pf_init_unit(struct pf_unit *pf, bool autoprobe, int port,
 	if (!pi_init(pf->pi, autoprobe, port, mode, unit, protocol, delay,
 			pf_scratch, PI_PF, verbose, pf->name))
 		goto out_free_disk;
-	if (pf_probe(pf))
+	ret = pf_probe(pf);
+	if (ret)
 		goto out_pi_release;
 
 	ret = add_disk(disk);
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ