Skip to content

Commit

Permalink
scsi: aha1740: Fix an errro handling path in aha1740_probe()
Browse files Browse the repository at this point in the history
If 'dma_map_single()' fails, the ref counted 'shpnt' will be decremented
twice because 'scsi_host_put()' is called in the if block, and in the error
handling path.

Axe one of these calls.

Link: https://lore.kernel.org/r/20200228215948.7473-1-christophe.jaillet@wanadoo.fr
Fixes: 1dc09e1 ("scsi: aha1740: stop using scsi_unregister")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
tititiou36 authored and martinkpetersen committed Mar 27, 2020
1 parent 1b72e86 commit 0f3d679
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/scsi/aha1740.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,6 @@ static int aha1740_probe (struct device *dev)
DMA_BIDIRECTIONAL);
if (!host->ecb_dma_addr) {
printk (KERN_ERR "aha1740_probe: Couldn't map ECB, giving up\n");
scsi_host_put (shpnt);
goto err_host_put;
}

Expand Down

0 comments on commit 0f3d679

Please sign in to comment.