From patchwork Mon Oct 24 11:31:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8531 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp407729wru; Mon, 24 Oct 2022 05:01:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6lWPEYY+EJRaSv57zGDJF6rrElk9bQqYtP31ouM1hhGbG247UDwYQawt+MElSrMc2m7RJB X-Received: by 2002:a65:6d93:0:b0:42c:50ec:8025 with SMTP id bc19-20020a656d93000000b0042c50ec8025mr27243852pgb.62.1666612898110; Mon, 24 Oct 2022 05:01:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666612898; cv=none; d=google.com; s=arc-20160816; b=SUPR69DQtYcBGEhlbDfAqFwbcw1+I0ZkyTTiOqrgrNSj1gG6fD35SmNQ+CCVG3M4aR p/LJZMYG0UJzGfKTZQJmjpwWXHC885TOkx15IgNCEBGSuVj8JCWA5cUi37FJ55AC7TpO PDBnzM7IDKEbJD4GgZO+CwiTYHdADb3YBTNBEmILVT7Bf3A0srcUr4YnwLjFAlQv2mML A1SgoO0BOOYhobCtCC12Q375N5FD9Y9W4T6w7rO7P+DmXw7O6d3KM/k6zr6jrLXBAqEB 7fYN8euPZqghELYqb+uWeUHKT01bdALXNsDV964eDstirKyMfIXjr+cieMN6Vy/tZpnz MiLQ== 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=ZfzToXs+xg4VYGjrdT49FsXUbgOEv8ZlgcKeGAb1D10=; b=AzNt+YcJx3U+6FFMCCDDGZn+o8+3PqQF5EvKhKbR1RZkYYWwOYFo4N+V2kvwpiZy8j 7X4H3nMjC5awOgGCzgXiU3zwbfN2GcrXqJ5BW4EWengecxDfQ7Mm7XvTrnjC2diI2cHo jfteOr/xbLanOYxvGA1UH3ioQ73BevCfB5i7EgIXs5sWpROtrwCu+ADnx+V+sjh6gxN4 NMz4to22SGL9tVs9VxKgo8q2Sk9qFbyhycwGNKmGMDLvt+AjkAMIebXIXruRYMocZAW4 rMrcE2cWLCaGGqQc91HXUs2MHiZS3VWFkN6u+rRcyLKu4m7XgxpVuLx5FShHLm+1Ielk VC3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qQZwLal0; 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 x2-20020a170902b40200b00186abd0dc61si2564744plr.386.2022.10.24.05.01.22; Mon, 24 Oct 2022 05:01:38 -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=qQZwLal0; 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 S232364AbiJXL5e (ORCPT + 99 others); Mon, 24 Oct 2022 07:57:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232218AbiJXLz4 (ORCPT ); Mon, 24 Oct 2022 07:55:56 -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 2B6E179604; Mon, 24 Oct 2022 04:46:57 -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 2EE57B81199; Mon, 24 Oct 2022 11:45:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8076FC433C1; Mon, 24 Oct 2022 11:45:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666611901; bh=Nr5t4iCikBHX1YYkYi3yjnB3SitGSSUtsTQsdlXTOmo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qQZwLal02ypnSz/Ese7WEZAKWRRGxFm4Jg8Hbn4zS0P3j6HjYOj7vYvQ02mxDhCeS WbIH4QkyYidk0kokTuzeedf6T+pUG3ydYElApGJq+T86zpL1NN2+POn2PtvoPj8RKW INjLEvxBIQ4wXLSoaAqUwpwSDJLX2NSHGiQPSP/I= 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.9 147/159] scsi: 3w-9xxx: Avoid disabling device if failing to enable it Date: Mon, 24 Oct 2022 13:31:41 +0200 Message-Id: <20221024112954.798605506@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112949.358278806@linuxfoundation.org> References: <20221024112949.358278806@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?1747570286184749186?= X-GMAIL-MSGID: =?utf-8?q?1747570286184749186?= 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 b78a2f3745f2..9c2edd9b66d1 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c @@ -2016,7 +2016,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);