Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6810438rwi; Mon, 24 Oct 2022 06:27:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7uOG+gmCcz/OWn+pYBGF0NrXtJlnntc+QxjUR8k0Iz9nKnBH6/7HXbOvVsHapxcjvtsGfq X-Received: by 2002:a17:907:2711:b0:7a6:bbea:683e with SMTP id w17-20020a170907271100b007a6bbea683emr5599473ejk.344.1666618031139; Mon, 24 Oct 2022 06:27:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666618031; cv=none; d=google.com; s=arc-20160816; b=fVE8VNvc3HSzJOGShZXA68A5+0a3WXq0BQLCUw7Ub33NMJw4+oHJkIayukTNHqGGe1 Opg9ni3spfWas5nJKAQYCvE+Q9f9w44UzyipkgPeno92OqjrAfFwzBxgaEmY52VSq+/9 hV9iJUU0VsFYy8FitkI3VkR5Zf8Ns05L7caQ56g8ryjaKKxQThlWS3q1UJPZb/T/BG68 fo91HYHuq3Jr/xSPkSMY5QUznsNu6Zb5FiCt37JGhWAU1ksY0B3L79c7kCQrplHgtIHk VjrWlPLirMjvh7/8WDGJf2uPwPwmrYOAjBrMBhiqb+5ldTiC5wZtvP22hNL5O8pS3sKr dn5w== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz42-20020a1709077daa00b0077ed84da316si29493934ejc.217.2022.10.24.06.26.45; Mon, 24 Oct 2022 06:27:11 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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); -- 2.35.1