Skip to content

Commit

Permalink
sx8: fix an error code in carm_init_one()
Browse files Browse the repository at this point in the history
Return a negative error code here on this error path instead of
returning success.

Fixes: 637208e ("block/sx8: add error handling support for add_disk()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20211001122722.GC2283@kili
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Dan Carpenter authored and Jens Axboe committed Oct 18, 2021
1 parent cfc03ea commit 5deae20
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/block/sx8.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5deae20

Please sign in to comment.