linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: aha1740: Fix an errro handling path in 'aha1740_probe()'
@ 2020-02-28 21:59 Christophe JAILLET
  2020-03-27  1:12 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2020-02-28 21:59 UTC (permalink / raw)
  To: jejb, martin.petersen
  Cc: linux-scsi, linux-kernel, kernel-janitors, Christophe JAILLET

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(-)

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;
 	}
 	
-- 
2.20.1


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

* Re: [PATCH] scsi: aha1740: Fix an errro handling path in 'aha1740_probe()'
  2020-02-28 21:59 [PATCH] scsi: aha1740: Fix an errro handling path in 'aha1740_probe()' Christophe JAILLET
@ 2020-03-27  1:12 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2020-03-27  1:12 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: jejb, martin.petersen, linux-scsi, linux-kernel, kernel-janitors


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!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2020-03-27  1:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-28 21:59 [PATCH] scsi: aha1740: Fix an errro handling path in 'aha1740_probe()' Christophe JAILLET
2020-03-27  1:12 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).