From patchwork Mon Oct 24 11:32:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9210 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp459202wru; Mon, 24 Oct 2022 06:39:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Y+6JQ7JuH/tIlxnqUmyR/jyD+M54DYBe/b0wNh3ZtbEeVCkYD9ui8PwIhQ23txoDYJSIM X-Received: by 2002:a17:907:6e18:b0:78d:b374:8989 with SMTP id sd24-20020a1709076e1800b0078db3748989mr27598343ejc.552.1666618745280; Mon, 24 Oct 2022 06:39:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666618745; cv=none; d=google.com; s=arc-20160816; b=L6rGXaHhV7/O70lum1HfJ2bMu4jjx19rsiFBwtVt9ugCC3rj27R+DkbsxG3Ciz+anV kWc0V2RN1r+omHpaLGScgbXX4u13baTqb7OLApXOvq6Zl4PqJJMjJLnukC4tyMH1T9qx 1YE41ld03DmRtwGDexXph+w52w2TlStaTxYIJWW6ywFuQGrf4Nhews4sLo5sRIAhV+hd YFB6hNYsOGefHtFoOriVPsm0gnDoiRBMw3UcSCV0YyIzsPlJnuGWgOCd1x+9MI9kctue 0wmCteGqypnjFjl5eSY/COKNxHQKP2LUvb3IAj3OMoakdIg9E4MPlDm1/FJ+kytFR3Zz NeYw== 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=21n0LQKx1VoXAm4S4X6UdvZsMWwuaFrM6DLuWvuOCFE=; b=E+EkB3tQO9JZG+0RKdhoOXuNUZEm2fBSKm/e6s1ywt5+kia4dl+JphIC0MLuQ3fTAr 5ewuc/h/eD8n8NjvJwXrbymtQKstpXfCjycGYCFNo5GPD9X09kImC0AamIBMiOUqRmFQ fj6y90bAKta+I/bmqPFTafEClRjp2oxOwb6L9dZUrltheB391FGV8eXI45fRPEcSgpIz JGDwjsFk7PucBkPwNnp7Nkznu2oBEsKOiAihGDta7pdNfjb754xHNC5C6Z7rruTYeD62 cCi0nioPlfApKjqwjhtPCn7wggmDlh7WbQOeLQsMWs0CgqPVVwJLxxiTAuf3jU7XvIzn 55LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dk6WjIp6; 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 hg6-20020a1709072cc600b00791a41d1b39si17220750ejc.656.2022.10.24.06.38.41; Mon, 24 Oct 2022 06:39:05 -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=dk6WjIp6; 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 S236359AbiJXNfZ (ORCPT + 99 others); Mon, 24 Oct 2022 09:35:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236327AbiJXNat (ORCPT ); Mon, 24 Oct 2022 09:30:49 -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 89E9BAC2A7; Mon, 24 Oct 2022 05:33:39 -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 9B481612FF; Mon, 24 Oct 2022 12:32:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0A5EC433C1; Mon, 24 Oct 2022 12:32:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614770; bh=N/ic3nvsn6gbap9xn1FFJo7xJmazvDTuIdIeuNaNTDk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dk6WjIp6h0Lp3thwlTeuiCM89mC+g1X1wTpzxsvSMZay1MrW9b5eZ4YdzaeL2GSKB jxOfx9ZbEtgteQqEt3dqhatGYHfKsPHn7XwW9sqIh8G/XpVrzUvRfvVOrPRc1shLWB vEDwewK1CH6QCU09QzYIhDNukhTiNY3ZpzSpzUC4= 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.10 357/390] scsi: 3w-9xxx: Avoid disabling device if failing to enable it Date: Mon, 24 Oct 2022 13:32:34 +0200 Message-Id: <20221024113038.202753438@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@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?1747576417365264963?= X-GMAIL-MSGID: =?utf-8?q?1747576417365264963?= 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 3337b1e80412..f6f92033132a 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c @@ -2014,7 +2014,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);