Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6743842rwi; Mon, 24 Oct 2022 05:41:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4aug2oCxzSKGwlFzaiqdC9LtWLX/j6pg0YTiPRXY4L3fZ5nLOlGsRqdztf+vXjk058vh5b X-Received: by 2002:a65:628f:0:b0:43c:dac:646a with SMTP id f15-20020a65628f000000b0043c0dac646amr28189425pgv.397.1666615263452; Mon, 24 Oct 2022 05:41:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666615263; cv=none; d=google.com; s=arc-20160816; b=MjDvO6PInBETvkLWqQF2VB6443GmLQr4/k+7GVBt8SGG78fhU7GmUUXsSaZAHU6ZnX d8bqEhjaXq5jAwsSPcT2CbO37CDoc2uDpZsnCNPhfvXaIwsEY3/7IQ6VzuRHn7j8JUiZ yu+xIpoDYrVc2xA/f4jVZ5Q01+aMfp9HjU6MA+ugTgKhrKdMIbqjKTccQdpSe18uZ+FV vYoYYg1LtS3/TdPiHZIiu49JiBlSxcvBEGfL2FelZY6p73quf8h9w0KC1YBy3g8Oxob5 ++BRtcGloE/+B5V1xCjp3y5od+RVt6/Vc5SpbKQwlxUIEdV2f7HbXJ/KeNohIvMmnXIt DsTQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qPgN/ywL1XVYy/UZQdW22KrhIU+9wHF+/rcXcbZ/DrM=; b=B0r9+JIti9Wdz/Nt44R1e3P90btM5wYmA8SVTEBzr2RTrYOlU/vqMOJY3r0/YOaB0F sBf1Vx9GpkChtR4VUdP60SPJHgouUWwDo2sXLIsZ1P4ikLsoJxwk40SWGx8nhHINYvKF aKi9OD72SdmRH10E4MoG/WpPQxqB9ODw5iYdrpueIwDxHuX98MIInnUf7FqC3Mqxyle2 G/2e00Vn+Ugl4ZLYo+0tA1Yu7Xpw26cnA5I1polBjLINns64q06tW35ysURBg3EdJQAa ool7GmhPfDnVLd7MUDQL9LsR+MkmDJMHYkQ48wXoFysccdRtm0uxC4wU4DyMQuSEEKr+ T33Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1iereAO7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s9-20020a170902b18900b0017f8d9b7e5fsi32404278plr.133.2022.10.24.05.40.42; Mon, 24 Oct 2022 05:41:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1iereAO7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233312AbiJXMUl (ORCPT + 99 others); Mon, 24 Oct 2022 08:20:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233352AbiJXMTP (ORCPT ); Mon, 24 Oct 2022 08:19:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A18527A536; Mon, 24 Oct 2022 04:57:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 77B97B81190; Mon, 24 Oct 2022 11:53:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9F06C433C1; Mon, 24 Oct 2022 11:53:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612431; bh=mzSEyvgQIhPHYGO2yz/6LzccyeE1JxvsydJsOQeo0QQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1iereAO71IypWMzpGyLie6BmkY59pbKlYDVY4mJ7zyO2SL/UnrnaFy0JMa2+kLMAw CR8ahxYb794BG25ufSmisz3SMT/rkAQphH0x/JQ/XLNlvwZUuauDrwD6+xEvk2Ynfp Oa2o7RSQFlQRD/f7uUqxI8Ue6LDpELhNQvNmy2R8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zheyu Ma , Letu Ren , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.14 195/210] scsi: 3w-9xxx: Avoid disabling device if failing to enable it Date: Mon, 24 Oct 2022 13:31:52 +0200 Message-Id: <20221024113003.291076821@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Letu Ren [ Upstream commit 7eff437b5ee1309b34667844361c6bbb5c97df05 ] The original code will "goto out_disable_device" and call pci_disable_device() if pci_enable_device() fails. The kernel will generate a warning message like "3w-9xxx 0000:00:05.0: disabling already-disabled device". We shouldn't disable a device that failed to be enabled. A simple return is fine. Link: https://lore.kernel.org/r/20220829110115.38789-1-fantasquex@gmail.com Reported-by: Zheyu Ma Signed-off-by: Letu Ren Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/3w-9xxx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index dd342207095a..0baeed1793aa 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c @@ -2013,7 +2013,7 @@ static int twa_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id) retval = pci_enable_device(pdev); if (retval) { TW_PRINTK(host, TW_DRIVER, 0x34, "Failed to enable pci device"); - goto out_disable_device; + return -ENODEV; } pci_set_master(pdev); -- 2.35.1