From patchwork Mon Oct 24 11:31:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8693 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp422593wru; Mon, 24 Oct 2022 05:23:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5hfWRgg7Z2IkgpeQbP8nNTqhtLtWQ7r8+EBc9Tdb5NI8iCgZE+GI1Onmf8WMEu1T0zb1Tt X-Received: by 2002:a17:907:7f20:b0:7aa:acf9:c07f with SMTP id qf32-20020a1709077f2000b007aaacf9c07fmr1109771ejc.559.1666614181409; Mon, 24 Oct 2022 05:23:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666614181; cv=none; d=google.com; s=arc-20160816; b=tKzzhEguEK2aDZ21Gt8i3edxefbCqwm5r5l4UfhkTp5OvyYriD1uNeWPYPBCJABmAs E2CaGvmfyd6kvOHPEJfHiO2Dq82jztZQjLrCQyPbgHmcBoF+2y+Zpri0fUuRhU3hLrGQ DVImjYnkaEubpSBFojwOt1VwAo7DsBAZDcZgNYHMEQWHehZo9B1/fPE0RgmZ7EQWwQ4C l+lYYVjbACO5DnKkZoYfN4qU36Bgcu5pVq3q0YxydH8nL9fdt+jxARs8DM1xkxiqCJOD 9kRFaT2ew9VtaIO/OtNP+YgCyVX/5XKfwAAb98O8AaqcWzBQh+yTu7YFN8ueCe2itMba yr9A== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g17-20020a1709065d1100b007316ac034acsi26541636ejt.834.2022.10.24.05.22.35; Mon, 24 Oct 2022 05:23:01 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747571631864795146?= X-GMAIL-MSGID: =?utf-8?q?1747571631864795146?= 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);