diff mbox series

scsi: aha1740: Fix an errro handling path in 'aha1740_probe()'

Message ID 20200228215948.7473-1-christophe.jaillet@wanadoo.fr (mailing list archive)
State Mainlined
Commit 0f3d679159f4cfb015abbb39e6031e79ccf64b05
Headers show
Series scsi: aha1740: Fix an errro handling path in 'aha1740_probe()' | expand

Commit Message

Christophe JAILLET Feb. 28, 2020, 9:59 p.m. UTC
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.

Fixes: 1dc09e120c83 ("scsi: aha1740: stop using scsi_unregister")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/scsi/aha1740.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Martin K. Petersen March 27, 2020, 1:12 a.m. UTC | #1
Christophe,

> 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.

Applied to 5.7/scsi-queue, thanks!
diff mbox series

Patch

diff --git a/drivers/scsi/aha1740.c b/drivers/scsi/aha1740.c
index da4150c17781..5a227c03895f 100644
--- a/drivers/scsi/aha1740.c
+++ b/drivers/scsi/aha1740.c
@@ -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;
 	}