From patchwork Mon Oct 24 11:32:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8974 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp438037wru; Mon, 24 Oct 2022 06:00:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7UvffM6PMIm+oyXJgzUgQn4AkqzkgxegEivbwZIRNme2TKhJtWKiDEPEZ4af3aGvirabyW X-Received: by 2002:a17:902:8693:b0:17a:f71:98fd with SMTP id g19-20020a170902869300b0017a0f7198fdmr33451547plo.25.1666616450755; Mon, 24 Oct 2022 06:00:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666616450; cv=none; d=google.com; s=arc-20160816; b=keVPxxKxNJ6rIV8FMwDeBJrciIzSFk/PpAskJzFjLE9a9qApDoh6X8poIJELqLYSPR Wo5u+FsSjWPIdwLHj1C6rGYVZBIpGrOT9bjfT+LIh2ZK/Bbf2L4b3VEaQhsYBBrmpbvB lbT2do0zNvrGJ/VLcwhFQH98P2iDoNfh2hNiF/LznYETFMwnWAWNI0mfCaTIXCxMcbBk 1e2llgIqu1ZmRcYbeoU4Q/CGw+NlOpVn4Pt/VVjzzvZA41CcWvMjNANHmrBxeRKOV1nQ GqID7nwfAue83qCDJUlmu555C5lXzlPnwYYKz8RSteB0JfEMQ+04XG0m8+i68actBO7I GTKA== 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=21n0LQKx1VoXAm4S4X6UdvZsMWwuaFrM6DLuWvuOCFE=; b=cxeHfLi3e6ln5xLnwWSwaiTSsvK3SoYPLxRba7qTRiYOL+NG7IHIyNuaP0j4ZMOcOe oGsHfKNc5k1HEsXItKl1+CCcOuoIbrmaZg7vrudTDkTbRIbymU6lKmhNApjp6xDjcvLx JT5HcbVCrXec/TKPTnolKUBoly80sOGige+gp9QtVa2x+vJgN2IXH7XUismqEP1RFdMo rDOfsZsqNrX/QriEHfZEZoWmJxgBew3DbF5XTCcl/43Fzko0ePyPoBZvxH3cAqXlvIQL xVKEcZYP/XbGBbIl/Mo76q72/9TyqPw/gZnpsJKWIn+x6jur8vnJwLApGIEKKlCH2dL1 ZEeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QNpHkygk; 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 bm18-20020a656e92000000b0046ebb8f5cb4si12218066pgb.691.2022.10.24.06.00.32; Mon, 24 Oct 2022 06:00:50 -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=QNpHkygk; 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 S234679AbiJXNAU (ORCPT + 99 others); Mon, 24 Oct 2022 09:00:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234807AbiJXM6a (ORCPT ); Mon, 24 Oct 2022 08:58:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B3F99835C; Mon, 24 Oct 2022 05:17:29 -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 E99086131F; Mon, 24 Oct 2022 12:14:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03832C433C1; Mon, 24 Oct 2022 12:14:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613682; bh=N/ic3nvsn6gbap9xn1FFJo7xJmazvDTuIdIeuNaNTDk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QNpHkygk6BHi8ENZaihv63PkVcrYAUjsvfPvpFIdzRiW9MNGziPn7E+DqrRPFbQy3 43SQNAzbzr/5+V7j765HrJA0WxTwDz+1shdVltTPjHRDFMSJNcTk3hsmNa/g5Yb7b8 om7LgwJzehwqJAnPYqqm5HQXtA+rU8gu4bmATbF4= 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 5.4 230/255] scsi: 3w-9xxx: Avoid disabling device if failing to enable it Date: Mon, 24 Oct 2022 13:32:20 +0200 Message-Id: <20221024113010.788560779@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113002.471093005@linuxfoundation.org> References: <20221024113002.471093005@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?1747574011784884538?= X-GMAIL-MSGID: =?utf-8?q?1747574011784884538?= 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 3337b1e80412..f6f92033132a 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c @@ -2014,7 +2014,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);