Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp200033rwi; Wed, 12 Oct 2022 18:35:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5WP4YF90aF18wSDGJXFRl+7jLddySVgAQgXkoqYoqreidu/2e2Fz+qyDIueRru2QJ1GGdf X-Received: by 2002:a63:1317:0:b0:42a:e7a5:ef5a with SMTP id i23-20020a631317000000b0042ae7a5ef5amr28392195pgl.392.1665624956711; Wed, 12 Oct 2022 18:35:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665624956; cv=none; d=google.com; s=arc-20160816; b=Otdqp9scUMxqCl5L8vRtkoCrpj2oN+0ZYAVpSNk4r7wHYp5m1kWpImaQ9FthoryoP8 I3IUZd2aDqP72ka1Vq1dUJmko52zPOmaL0O1OgazKt+YxSlG8miTuzyv80kIyLizrigH gm5WrNJ/VYgA5y1/wHv6KFjfnl5ZbonnbNicixY1D5Xjxe8swD8m24whBSTzwFUx0SBh vQUe+KKn0yEdKigilIow3/LHwMG+jQkvR+NSqO3m/qXnLOnp11h43yJ7ms2MlLHHCGTP Mfr2yQwxdiXNzukb0zIekv+S9fMaEm++n6WF1fu29LwgUKXUa+a9NONBlBfzM9w4k754 6juw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NyFvXrgHPwpCuFHn+Gg/htzby8c/N8ygfLM+53TiBfo=; b=KsLEO5z4mK9lnqM6HaPFI4Xk0CJVzmbGRPwlmUpFqUI1lPxDDRtUHB9lxd18utMnNj y/QpIT3YH/c/ucGB3GNhTDPTGXlfnNKmqz/SLJPi9n3G4w3fZZUnv9RPsQ7+f4dw1DS+ njeOGUSZaig185tW8xefkp3tQvmtkko9/Hcwy1+9O3PzTSpGs0oGNkJwF47fQe4tawwz LeYTtSXOnGDOCsK140yJOWzk5AY93bqzstUTKOGLZfjQV0I+Mv78tZs8KYiuuY26lLgc QDwP1TU9h+3dcLk1FJmnP74TslvokpUlwK8sXokvHmrj8b4ivnJxdEaotsDRqUinf1Lu Mv8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=i0rNXPfH; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c10-20020a170903234a00b0017d2c45e8ffsi23683777plh.171.2022.10.12.18.35.45; Wed, 12 Oct 2022 18:35:56 -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=@kernel.org header.s=k20201202 header.b=i0rNXPfH; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229505AbiJMAQ7 (ORCPT + 99 others); Wed, 12 Oct 2022 20:16:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229844AbiJMAQp (ORCPT ); Wed, 12 Oct 2022 20:16:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C02BE150486; Wed, 12 Oct 2022 17:16:21 -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 5B604616BF; Thu, 13 Oct 2022 00:16:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0683C4347C; Thu, 13 Oct 2022 00:16:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665620179; bh=Es5nmzJdT+oW3VwkRSQOa1PJ6ac1UPOFRjBXyXVSk/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i0rNXPfHQ3TU0ozOm7EpfsP0eQOEs7ApZmY1pqkRrcYBLmPVTOMNfQ76Hma9oCqy1 /lm/M7tS1XVLsuPNu53wQInDFyOOWQ17dmA7pqh5URKyHgEpgctnAYfnciEdIDjZ5y EtKJsb/0c7B0xnvuHawXHixysV5EBp/7nWRCsUgjAgY9quPJ4VkgdsAiaUgEsoShAX UA9McVHOdqTfSIGB7gYbtsym5aOn8jzkXHdOk+6XdBSJ1wVhB4czjcgT6/G7/vMM6V hTdifyre+9qyb0wrbhQButygGlCGhEvdipEJz7M8O6Lusf8rxr5R16qnVn9CyRQ7I4 RMTsHaJp/We+w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Letu Ren , Zheyu Ma , "Martin K . Petersen" , Sasha Levin , jejb@linux.ibm.com, linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 6.0 11/67] scsi: 3w-9xxx: Avoid disabling device if failing to enable it Date: Wed, 12 Oct 2022 20:14:52 -0400 Message-Id: <20221013001554.1892206-11-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221013001554.1892206-1-sashal@kernel.org> References: <20221013001554.1892206-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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 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); -- 2.35.1