Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp899815rwi; Wed, 19 Oct 2022 04:30:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6reRlBG6oM2W7lJuNblOJvDlD68nmyCIBtqgl6h6NHL135w7orbF4RaBrJKNixq4NFPpPn X-Received: by 2002:a17:90b:3a90:b0:20d:a54c:e5cb with SMTP id om16-20020a17090b3a9000b0020da54ce5cbmr9386399pjb.109.1666179026647; Wed, 19 Oct 2022 04:30:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666179026; cv=none; d=google.com; s=arc-20160816; b=NHZ4VLxLZ4RH8ELfmgz20sD4pwfJs+HCXKI8m6SQdeOy7h+gk4dT6MPz35hbB4daEh Ko81XDI0lbvANv79aBod+ZG9SxaQpjcskQhBMqxjoPymLZuzQ8VM23dKQUV7ZqP+VY9n Qiis4NPG29vZoSj0c0K3hkoNd5GS6MtEu+JIwNnbbE+hXZWjK+OFzlRp0j7LmKIQZzr1 cMDJYlpDD5zkQdQIfKE2eS8Og3RZh7zJXr4sJVWhOUTFdd0A/eA0y7qVYZnQfh3XD3eM AwryMRDhYoOWoJOux7+zNSZRu7bJ1WOEX7QyJxxgNgh2LdISJ8BfL8d63ppuZRpNdfKw rtDA== 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=NyFvXrgHPwpCuFHn+Gg/htzby8c/N8ygfLM+53TiBfo=; b=zEsmf/kPdrbqAyFk/bp0hesyDMGDERsfZ7DOQ7mFVqNFXy3c+yVFy6LX8eQEqDQdzE 0mpIqLw2+PsGk2FXLSG9xpHYA3fE27nSTveSwT84n4ZobQkup7KuQ97Bf7L/+3Y+2quv FUHK5+KGAMt7QKtv+m3gpaufv0OEcq4mN0LDXBNq/Q3FVoWSiHHyx8iGu+SmmtIAWfoI GpMCPFSXkPdSHUP8bpWKkB/p4rNP1lgzAogKGJLoUYj/3FaZGyOFah8TIFYmbD1NTUsN xzFVMOercv/rtFWPsKsincJD391jnvb8anAT3hPJ1uF+FQiKKqihJdILbvmxJvBLiWcd kLMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Z7N2ATsQ; 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 d2-20020a170902cec200b00172696f35e1si20046183plg.482.2022.10.19.04.30.14; Wed, 19 Oct 2022 04:30:26 -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=Z7N2ATsQ; 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 S230220AbiJSKfb (ORCPT + 99 others); Wed, 19 Oct 2022 06:35:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229994AbiJSKdv (ORCPT ); Wed, 19 Oct 2022 06:33:51 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAD85FC1F7; Wed, 19 Oct 2022 03:12:58 -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 sin.source.kernel.org (Postfix) with ESMTPS id E9CE8CE21B8; Wed, 19 Oct 2022 09:13:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E64D7C433D7; Wed, 19 Oct 2022 09:13:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170827; bh=Es5nmzJdT+oW3VwkRSQOa1PJ6ac1UPOFRjBXyXVSk/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z7N2ATsQ+4ddQXpbFSIsouTFiPPbE3AX/HAllpgov+NbVgoDL2C78GqzByjtXfUJL tVlxABd8x/jdaFAccYYZME7ET6waLx+k0KeQ//p0XzpTp7/1Gxi9ftEyIhzZ9STmMP QzNfdCn1CWhFnk8Qi/xqe1RcVsn97IBgFvNaVqlM= 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 6.0 801/862] scsi: 3w-9xxx: Avoid disabling device if failing to enable it Date: Wed, 19 Oct 2022 10:34:48 +0200 Message-Id: <20221019083325.291693919@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@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.4 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 cd823ff5deab..6cb9cca9565b 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