Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7437764rwi; Mon, 24 Oct 2022 14:48:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7ixN857tmIljR0044RSsNUJLnxEySd+qMEslZdDyJu0KR34Bsf1KbjoUDCiiomEeR43U3U X-Received: by 2002:a05:6a00:f0c:b0:563:5159:e300 with SMTP id cr12-20020a056a000f0c00b005635159e300mr36141629pfb.65.1666648101096; Mon, 24 Oct 2022 14:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666648101; cv=none; d=google.com; s=arc-20160816; b=ng9P2KVt5mwrc67BkdW2ZtYmzTKNeTxRpQBFl96NUFtzhzzLQGHf9Jkg0uTv5g1T+p jbCenyb5egN0rYEx48B7ojhKxSIgCwAZG05e/xCTT0jvbOpO1V4eWFatwL06keW20QVe xwt84MrA8EMVIL0BzldybvW/D4ikfaf5r3LX+AhwEk/2UY3jn6MCeECipfsF5oxNJtHv hS9lkcfr8l4RTuuQyjJWo/8Ar8+XpZHM/jA6OC/LbhFiAY/oKOEa5wSxwGlrThrfb7zd N3aoM4IEzulieHpdlTdLuWrUHmA9E5V2Uu3WevqRb/8uDt6qCIVu3YklQal7kdYvcvgF U78g== 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=cucQtzdpCBD5y5fNHGKmYdu1OVFx2u50v8Gf6EwUYgE=; b=EZHGiQQPSuoxMY4XVI4p46R3nrksOl+RSuVJv9D2vwSrY6dsM78S0qeiYQLMOkJp4d N33sDIJvef7v7b/5wjQRW2/n3zk+EfRa77jEAXQoqmXa4zC5JqLzuXkdfW1vaQpMWIbL /jY+8LplT4Zj+pVIvmlpCv4CjA8EIjpqB1PUWsVTFZ4yLUr+JOpE6TIq0Uv4VQ1Iyut7 gum0hlW/lwixS8jEHupITFf+4gXw1EwERH8IQRzu28P7u0K/TvCE0a+vYf/WjgwKrWyl mkXKgUKm0ptvNo6Gu8m8VPJ5pxNEFGX99v6QbSyaeTmjEaKUaQEPcbkI9bqUV2zzXo2u a7lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wtMp5BLP; 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 sj11-20020a17090b2d8b00b00212d5512d2bsi1186969pjb.78.2022.10.24.14.48.08; Mon, 24 Oct 2022 14:48:21 -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=wtMp5BLP; 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 S232901AbiJXUaM (ORCPT + 99 others); Mon, 24 Oct 2022 16:30:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234618AbiJXU3c (ORCPT ); Mon, 24 Oct 2022 16:29:32 -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 A5701EC50F; Mon, 24 Oct 2022 11:42:20 -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 8DB08B811FF; Mon, 24 Oct 2022 12:03:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1333C433D6; Mon, 24 Oct 2022 12:03:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613022; bh=YzIQwmqfE2s9hKK5FABSVnPtBIwFJRppvwDBQ0Ueq18=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wtMp5BLPf8LHFOrMsPaxsKWJxVC0e4XcmtKVVF9NwowrUHQhOgP20H106QzWzPj9q yWmpU+F0Bp0l0jLceIDSYN1o+dxQrtQcxoNR4N1OB1FqV9JXlem4X9etjLIdIOUflI DMKCVWJodr9wNR0rb0pXqbX8NC9nO++TQq55XWoo= 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.19 208/229] scsi: 3w-9xxx: Avoid disabling device if failing to enable it Date: Mon, 24 Oct 2022 13:32:07 +0200 Message-Id: <20221024113005.922926283@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112959.085534368@linuxfoundation.org> References: <20221024112959.085534368@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 27521fc3ef5a..ea2cd8ecc3a5 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c @@ -2009,7 +2009,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