All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] pcd: capture error codes on pcd_probe() and pf_probe()
@ 2021-09-29  6:40 Yang Li
  2021-09-29  6:54 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2021-09-29  6:40 UTC (permalink / raw)
  To: tim; +Cc: axboe, linux-block, linux-kernel, Yang Li

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@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-29  6:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-29  6:40 [PATCH -next] pcd: capture error codes on pcd_probe() and pf_probe() Yang Li
2021-09-29  6:54 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.