Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B99FC433EF for ; Mon, 15 Nov 2021 20:34:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2BDA260FBF for ; Mon, 15 Nov 2021 20:34:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351709AbhKOUge (ORCPT ); Mon, 15 Nov 2021 15:36:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:50070 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240231AbhKOSH1 (ORCPT ); Mon, 15 Nov 2021 13:07:27 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D8E7663303; Mon, 15 Nov 2021 17:43:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1636998225; bh=H4qjAOMbG5tTX3XaVQorMMmPmBn+OjvHU7MkW8h6F/I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=br/rkUpBVbhUZO54rmH8FEKF5OeNYcqEsJbIFqcVlrY+v5gwj2MrRLYb8jzMPRykn Q+bQQB9e7Do2ZjYZT5cWoyfZS7jKfp/2J4Ljm29Ax//fx+jnKgB+hOUSE6pS8uc8ab XLBfAgBuGSDgK1CTk9s1NY27mBB31iGDfnnHVirU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Finn Thain , Tong Zhang , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.10 401/575] scsi: dc395: Fix error case unwinding Date: Mon, 15 Nov 2021 18:02:06 +0100 Message-Id: <20211115165357.637171339@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211115165343.579890274@linuxfoundation.org> References: <20211115165343.579890274@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tong Zhang [ Upstream commit cbd9a3347c757383f3d2b50cf7cfd03eb479c481 ] dc395x_init_one()->adapter_init() might fail. In this case, the acb is already cleaned up by adapter_init(), no need to do that in adapter_uninit(acb) again. [ 1.252251] dc395x: adapter init failed [ 1.254900] RIP: 0010:adapter_uninit+0x94/0x170 [dc395x] [ 1.260307] Call Trace: [ 1.260442] dc395x_init_one.cold+0x72a/0x9bb [dc395x] Link: https://lore.kernel.org/r/20210907040702.1846409-1-ztong0001@gmail.com Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reviewed-by: Finn Thain Signed-off-by: Tong Zhang Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/dc395x.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index fa16894d8758c..6cb48ae8e1241 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c @@ -4658,6 +4658,7 @@ static int dc395x_init_one(struct pci_dev *dev, const struct pci_device_id *id) /* initialise the adapter and everything we need */ if (adapter_init(acb, io_port_base, io_port_len, irq)) { dprintkl(KERN_INFO, "adapter init failed\n"); + acb = NULL; goto fail; } -- 2.33.0