Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp180036rwi; Wed, 12 Oct 2022 18:12:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7LEdDgRf9gokjMMSg/YcrqisrVfE/xCeZNplD0qKOTfGcVsbzWbgsfJ1sos3jj6rRMdehT X-Received: by 2002:a17:902:9f97:b0:184:983f:11c5 with SMTP id g23-20020a1709029f9700b00184983f11c5mr5342874plq.89.1665623555139; Wed, 12 Oct 2022 18:12:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665623555; cv=none; d=google.com; s=arc-20160816; b=otOLf9ZMGK2T06Z8fxMZihgMAJ+fPGP+QM3n6r8MIX/TVfQWFBZvkc+GcSeVMU15nt 0vblsQ3Rn8/XGiESYPaTYHAdFM4sGyK75oy1MWo3jenqoA5Udq/BdGC0sJvSuZADY2eU hJFWD7suU5piYRQky6K+DeN5dfCvr3j68In5O457hyC1JISgN58q2z8WVXTit8XBtifM dK3MC97+ZWkS7PSW0U4n+7Cs1VTWtvQHoUOh00wiRHvKAfPWVpn+aCggPcrDmz9UM3YW 8TfmF2AEh2BQJp6b9EaMwjUQ5+MvDVWrfJO1Nrp3fosBQy6MTTgT6Hyj29kFmCtgGzxk aQPg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6nEGX3/VP0jmCH04QjatzRXuD1v86cBRmoCZizhDU9o=; b=GHlYlDSkoP6dQ1DZIH6Qvj/u7hn9SAhywYhmkoZ/EcLqB1v3a24nK83g6Lzcw0XNuX //sunPzWxFFck8YS7TWh8ulns3zs49ck7x46yEHM1jqbvwLW5Kh7Jre/M0dY3jPYjo84 Hi80r02UGdaLQkddtAiDo34Jk3ePNZTYqmsGtdX4ICeqn7qYSiPHQt13lDrGhYYmbwzc 2OvYrIXHEwPsO0DSXGDVv2hwjdRjJbdEqXpRVob1cLZj7TwYiBwcH4IP1x3n3jEzsG6n EaSOaeucRx+VAOQ2rn/F1BFoJ/uujXYSA483Om193tq4Ki/ZY3OrUMvUJ7AQI20IzyG8 /pgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KPbetNGb; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oo3-20020a17090b1c8300b0020087bc6415si4080475pjb.16.2022.10.12.18.12.22; Wed, 12 Oct 2022 18:12:35 -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=@kernel.org header.s=k20201202 header.b=KPbetNGb; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231676AbiJMAbP (ORCPT + 99 others); Wed, 12 Oct 2022 20:31:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231408AbiJMA2d (ORCPT ); Wed, 12 Oct 2022 20:28:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C31D15E0E0; Wed, 12 Oct 2022 17:25:27 -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 dfw.source.kernel.org (Postfix) with ESMTPS id CFCE4616F5; Thu, 13 Oct 2022 00:21:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E844C4347C; Thu, 13 Oct 2022 00:21:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665620511; bh=wywoabG9rCgAtYcjbucXslM1obEsgJ2KIBItP/wqNMc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KPbetNGbymTA5rREsAAE8fwYtAQFHTDAvgTHDmxOIjxLT2Mo0L2YeSwnYdDxkxhmv fB6mJsYSuJk9Rc0jF58vKVXrtcudYYYRv+tdrpYFui6iXkbGO5wzD2pizyttyfOJ+8 z1WxvXGzDA+ruze1PkbP4iyPMP6qwAdwubESgdXXSskhS91jX08ximlp1mHijmTTvE u+AB/O3NBB7z8vV4z6FUU+calkQbK6yFu4S2ZlEU8HryoDdR48hrms2JKTF1xHkwKc ZrtZpWsBUdqAHpWXCGWKeN7OpyOeWWy4xLO0zer5xFsLjg4Vhe9ZGHIxqXCWb2qUdL FtDhJbho05Riw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Letu Ren , Zheyu Ma , "Martin K . Petersen" , Sasha Levin , jejb@linux.ibm.com, linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 5.15 08/47] scsi: 3w-9xxx: Avoid disabling device if failing to enable it Date: Wed, 12 Oct 2022 20:20:43 -0400 Message-Id: <20221013002124.1894077-8-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221013002124.1894077-1-sashal@kernel.org> References: <20221013002124.1894077-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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 e41cc354cc8a..6da591508f23 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c @@ -2006,7 +2006,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