From patchwork Mon Oct 24 11:32:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10200 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp642039wru; Mon, 24 Oct 2022 13:37:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4IhETYnN4JZ6awmZZm3JqHV6QcO3wc48PgMN3kdgEMLgt81aUVBvsL8XU3NMLeZRVttnS5 X-Received: by 2002:a63:fa17:0:b0:43c:3f26:48e3 with SMTP id y23-20020a63fa17000000b0043c3f2648e3mr29757001pgh.66.1666643832472; Mon, 24 Oct 2022 13:37:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666643832; cv=none; d=google.com; s=arc-20160816; b=avc07hQFWithhE4OslUV20/E3Xg724Ma4urB+z5qrzZL55EoTNERzGu6zo52+6DyYb 0vPMlJB/zkOqHqNPuKzM1Sgw+Sjz+zsPOJFApmanwk9QarG+T1qmZtzkBEi2+3rsvzfd iLKfOoBJ5wv17eWIgwERuPLzEeVWbLxibSnjpP+7JKfSLZsoGkai57MBIj6mdu9KkGGv vyY+TfHbFCLkH8ivvdjaVlDkfiNvPbRnDfilDjJj+ZgRXBZSE0wgX+ZD80iMXkvkdM5J 8hcyQENKkY8bWSOo96zvirWowv5YcM9gv7QjqnkzaU1lmMSF4KagfsKrGKuOKT6AwvQg RMpg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pg16-20020a17090b1e1000b0020dbd4207fasi13046173pjb.46.2022.10.24.13.36.59; Mon, 24 Oct 2022 13:37:12 -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 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?1747602723605446698?= X-GMAIL-MSGID: =?utf-8?q?1747602723605446698?= 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);