Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3396937pxb; Mon, 6 Sep 2021 21:09:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvWxudpanfQYwj3F1UrecoruDoNQ2z/3rz0VRuv606Shl4ZHRCbRa+ClvbONvi73nxjg6T X-Received: by 2002:a02:7710:: with SMTP id g16mr13682498jac.148.1630987756821; Mon, 06 Sep 2021 21:09:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630987756; cv=none; d=google.com; s=arc-20160816; b=N7kXvQMq36VxqFFC/EjytOKZARHcqS1NacQb0gL/Lt4uefyBx6yc5WTofdfWUTwQvU 0NZR76H9TbVsd1bmNlJ7H9zLo4GnyCAvmR6LhMBL9aW2YHIYsnu9W4fmYMJ89WQWTHrZ uZ/H3pCbOpZDuQqEoBWJYDOb7Yn9/XMohaOixK1mRoEh0JkAw/dwgErFffIHxieViKIw PggDSAizUUGyOE0RnrNXFemwP8lKRxn3tEyGiSPZ9LDcUVeFSDYVP3iKfhT9kVBf22Z8 fD1LN7D1EcvayGQidjcg6YdYWb89fSTP7T53EMGL7M/9v144KUAFUmBq3FYsrYocRLJ/ m2rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=eoAtwz/HI/43X/dImzE2MSr2lE2uK0vvPjZTO/+eO94=; b=yqYCz8P5vNojpZtmiLvGnYzqnYk2Vq5JPSOBQINfy+tysUX6PYzjMqcXjB+EROgCTP y8e3UOE365/00i4ALoW3R7eD/ygnLxJhzF4F0O6fyBu3/8YgaXrola9fEfbQd9qSDN75 f3IjbKmX3AYv0xOsr97+NUk8mVP3wCkmmjBKy2zF1lTspLcGt555c0orNerbseCe1DHI w4wjBZW5F9eQkFtV/h6uDW/gylQ/Q6H8MZ4qH7p1efpD2JPagOL1LiBrpRrXXCLDLrZi Rp3Vh3KNG1VROy/C+6RWdiXpQwsOecjVmFzn72mAofqOE/xTAuQiR+CngugsmKi+prz9 yImg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nkBZzaoG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si10295407ilu.9.2021.09.06.21.09.05; Mon, 06 Sep 2021 21:09:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nkBZzaoG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229784AbhIGEIP (ORCPT + 99 others); Tue, 7 Sep 2021 00:08:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbhIGEIO (ORCPT ); Tue, 7 Sep 2021 00:08:14 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF95AC061575; Mon, 6 Sep 2021 21:07:08 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id f11-20020a17090aa78b00b0018e98a7cddaso1181723pjq.4; Mon, 06 Sep 2021 21:07:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eoAtwz/HI/43X/dImzE2MSr2lE2uK0vvPjZTO/+eO94=; b=nkBZzaoGaVDLDtJbh82aWdYllxxJ0jwYm7q+0OQTUS6OJFNBhtDnSmC75Hiuk2T87y 6KHWCQCC9IA6ZnnCNER/D32f9M7QiINiDjQvAazh2KvJbX+ytN0bqr0/R4VQ4Ot3LwMs SWbJMgIGGIa690jvX8/zACeO3qw3Ak16LK0fU1nDB0AJWfZq5XajX6MHMvrSl1tPvhFf /sH8z5lgk11mFljz/q3yNPxTJcvHQd8qAZs27cQMgV61CfqMeQHNvINKdpg0VZRzUiWj NE+uTj64sPJCWUQ8USGSgfj/JGsbM6nfoJm9BykLkZpkAWg1u5P+yACXXiLi1I2nZqNw hvlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eoAtwz/HI/43X/dImzE2MSr2lE2uK0vvPjZTO/+eO94=; b=YXrFBX7fIFA4KUFFsTOPjzHd7j7vGrAUyhswDk8ZzNkYxRcxVTHOG3uIKLmwkBKBBm LJqhb9FWV7V0kDl8w6xwA8ugmXzsfhfQ5krggI95BK6raohAXauOBu5HgX/MIhUM57UO oaHqWAeQYTQ6nxBgLWFHatzF3TpCTL2XM90MIubqYdMiNqUNUtNvJrDlASn1jNLOMKrt pngiFSMoxI75yDJe3CFjOFHPFqbw15WrZs3udq20ci9UKDg/deVhzP+kVyRYLXXNIgdg CgjWoNgzVQNIzAPZFy23l+dEbx+p0NlmhEJJj5oNtijyNljf+vO0a2nGqpZYULHZ38Hl W9AQ== X-Gm-Message-State: AOAM532ggaY0PWp5cS5Y7Gfq11geupejyJrJw+1UQ45VSJuGC8tuqbZj z0917BelCR5uasFAhzYflDE= X-Received: by 2002:a17:90a:d98f:: with SMTP id d15mr2445084pjv.81.1630987628198; Mon, 06 Sep 2021 21:07:08 -0700 (PDT) Received: from tong-desktop.local (99-105-211-126.lightspeed.sntcca.sbcglobal.net. [99.105.211.126]) by smtp.googlemail.com with ESMTPSA id b7sm8894873pfl.195.2021.09.06.21.07.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 21:07:07 -0700 (PDT) From: Tong Zhang To: Oliver Neukum , Ali Akcaagac , Jamie Lenehan , "James E.J. Bottomley" , "Martin K. Petersen" , dc395x@twibble.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Tong Zhang Subject: [PATCH v1] scsi: dc395: fix error case unwinding Date: Mon, 6 Sep 2021 21:07:02 -0700 Message-Id: <20210907040702.1846409-1-ztong0001@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org dc395x_init_one()->adapter_init() might fail. In this case, the acb is already clean 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] Signed-off-by: Tong Zhang --- drivers/scsi/dc395x.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index 24c7cefb0b78..1c79e6c27163 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c @@ -4618,6 +4618,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.25.1