From patchwork Fri Feb 28 21:59:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 11413307 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5952014B4 for ; Fri, 28 Feb 2020 21:59:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 42A2E2469F for ; Fri, 28 Feb 2020 21:59:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726673AbgB1V7y (ORCPT ); Fri, 28 Feb 2020 16:59:54 -0500 Received: from smtp09.smtpout.orange.fr ([80.12.242.131]:60021 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726627AbgB1V7x (ORCPT ); Fri, 28 Feb 2020 16:59:53 -0500 Received: from localhost.localdomain ([92.140.213.100]) by mwinf5d18 with ME id 8Mzp2200A2AY1JL03Mzq0s; Fri, 28 Feb 2020 22:59:51 +0100 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 28 Feb 2020 22:59:51 +0100 X-ME-IP: 92.140.213.100 From: Christophe JAILLET To: jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] scsi: aha1740: Fix an errro handling path in 'aha1740_probe()' Date: Fri, 28 Feb 2020 22:59:48 +0100 Message-Id: <20200228215948.7473-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- 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; }