From patchwork Sat Oct 22 07:28:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7836 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1152712wrr; Sat, 22 Oct 2022 04:03:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Wusa8zz4PuQyjp93GSCcJ/6EWSMOEzbZho/MIwuII/2RiSbyCiF+hsHrKMzVMHcY1Lv8p X-Received: by 2002:a17:907:60d5:b0:78d:f741:7f9b with SMTP id hv21-20020a17090760d500b0078df7417f9bmr19272641ejc.314.1666436633901; Sat, 22 Oct 2022 04:03:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666436633; cv=none; d=google.com; s=arc-20160816; b=SDaLyU8Md0ciU4HRUBN8RI6qeQ3rI9MTUBsV5Yw7sKInmTJIh/opWbqmaIcmeVzgFS Pwd6w0RxyR9ytLuh31PvBzDxryYKYvYrKaYvMuT0Gj9FQwrV1By4Oo96yYMi5A/ytWso msF2tUz4BKdgJeO2eYkWSk7xMWTqw2Ze9ixqZBy7xenvdXoPyBAQC0rA4ivWVZKN+5Io YwlXfhvfECpZ8h1bVDYUrx4oAfRtMODqVSquo8e0E9AUm/N1/iPmdRhGchn4adVnjEmS OLyDHrY5CLBacAsNYg3QIzvHhBAza7hwfe8dZPGmwJFCJxi6BVeCmFwk2cZeQh6eTA4B zsCg== 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=xFtv43WgXBHiCzq5kg0xWuciaHJ0K/096pbsNP1BcvlwN0RV0IkO1W9EWMiuq1K+A8 b+p2ToGEzjKLPXIlZVwoRVgH29kdWy/8BU2fSNBwdtuYa37cHvxk4laQMDJlKpdli0lc UPbVN5yJLkfSLjHjCwXxrKgccJ6BgvhLaAuty6d4bGDECPR0fD/rDJdb+RdfCOZ9Hp0Z gFL97+NUj6KsIh9QjBv0lVtZd8HFEWFAqf+QLFGq85DwVbuxmiAdeUGBW8g658SmiTxh XkSJVItPdJ8/K0vN7WjJ2aIU6a6QVo0YY9Kj56LKnPhAUXRhGd6e/sQrCs9BVOaaHTZ2 NfKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=J49PEHrY; 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 hv20-20020a17090760d400b00791a67e4c00si11375981ejc.835.2022.10.22.04.03.20; Sat, 22 Oct 2022 04:03:53 -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=J49PEHrY; 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 S230478AbiJVKzg (ORCPT + 99 others); Sat, 22 Oct 2022 06:55:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230210AbiJVKzK (ORCPT ); Sat, 22 Oct 2022 06:55:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BA9C9AFEC; Sat, 22 Oct 2022 03:13:19 -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 EA40860BA7; Sat, 22 Oct 2022 08:06:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6071C433C1; Sat, 22 Oct 2022 08:06:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666426009; bh=Es5nmzJdT+oW3VwkRSQOa1PJ6ac1UPOFRjBXyXVSk/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J49PEHrYgybiGMY8wFJW28tu3250YZBwNoSucz+C9pmbozVZPmiSTNOCJe/fZr6bA b95yTW5QXpnwCdlpbUrKlcAUsdyciRHqnHmGmPRyWasecpgZ7aMh7WztCVZLRJnhjz n71VHis3BmNk+kI/HeWzT7KM9iLPap+Mnhso8+2k= 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 5.19 659/717] scsi: 3w-9xxx: Avoid disabling device if failing to enable it Date: Sat, 22 Oct 2022 09:28:58 +0200 Message-Id: <20221022072527.546168155@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747385459864036450?= X-GMAIL-MSGID: =?utf-8?q?1747385459864036450?= 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);