Skip to contentSkip to conversation

sx8: fix an error code in carm_init_one()

PATCH Applied Dan Carpenter 2 participants 2 messages Oct 1, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sx8: fix an error code in carm_init_one()

Return a negative error code here on this error path instead of returning success.

Fixes 1683818a4f1a ("block/sx8: add error handling support for add_disk()")
---
 drivers/block/sx8.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/block/sx8.c +3 -1
index 1c79248c4826..d1676fe0da1a 100644
@@ -1511,8 +1511,10 @@ static int carm_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
 	DPRINTK("waiting for probe_comp\n");
 	host->probe_err = -ENODEV;
 	wait_for_completion(&host->probe_comp);
-	if (host->probe_err)
+	if (host->probe_err) {
+		rc = host->probe_err;
 		goto err_out_free_irq;
+	}
 
 	printk(KERN_INFO "%s: pci %s, ports %d, io %llx, irq %u, major %d\n",
 	       host->name, pci_name(pdev), (int) CARM_MAX_PORTS,
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw
Quoted 2 lines · Dan Carpenter

Return a negative error code here on this error path instead of returning success.

Applied, thanks.

Signature · 1 line
Jens Axboe