From nobody Mon Dec 15 17:55:49 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6A1DFA3740 for ; Mon, 24 Oct 2022 12:20:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233291AbiJXMUm (ORCPT ); Mon, 24 Oct 2022 08:20:42 -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-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 stru= ct pci_device_id *dev_id) retval =3D pci_enable_device(pdev); if (retval) { TW_PRINTK(host, TW_DRIVER, 0x34, "Failed to enable pci device"); - goto out_disable_device; + return -ENODEV; } =20 pci_set_master(pdev); --=20 2.35.1