Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2119132ioo; Mon, 23 May 2022 10:28:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycjTtKYSPYvNh55ejilQez85OudYFu7QIPMUvXgTjwOcJp8KHkEE6ANveE0eC/nmhBq/6d X-Received: by 2002:a17:902:cccc:b0:15a:30ec:2f56 with SMTP id z12-20020a170902cccc00b0015a30ec2f56mr24069940ple.169.1653326890457; Mon, 23 May 2022 10:28:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653326890; cv=none; d=google.com; s=arc-20160816; b=GqiPwwzy/PWc6b5RYiN+Mor4hgBUX3shvjFw4bOqs0EGQrMzhHeAA925bHFeaj/6B6 gDyO3LHstn8TJtjkOq2Nz1AoXIgQQQnZGXRtjQ8iriLP90s4K6ntxXfNwxCJJp6URJJp o4cH61fkStxwhPlk01JSWPP7ydwETMRc01M23tzbjbgaPIuQjr9yA4k4Rkmf4Udd3rM7 ZgoVk5/UrZh4wylrvAnKedfbzk8MHCR7gfhcl5yVY45bTqGJ12rYFyYrWygJhUHPj/Tq gzE5OABTXHmGjPC3jF6OVip9Qzu6GZJ/JCNlngn7v+fJtX37Qs1YfaVT1BdaRt95E1qq SU8A== 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=hdZxupUqYa8IsICwKWybJw+ijjNmdfhg6egpw/UW0eY=; b=HgYRD9L+m89klUrOyqHRiA2NTMP+zncOer/+PhTVu2C34h7+KlQz+RPDbdBoqYN6oG QXZCg3GJzrUO2e8ZPO3G2pBxEmwp1oBYmzDmWGl2kOXCPxJAtVNqpp0HAwkuqegOAqjP g54mKpgyS72VAitQYEie37mBoy0SKJpvweas8mz15OtEwZdhF8diAwz+2ekGA0lNnnQ0 fm5IW6UhkExME4TL+33MJddoKFmzHd5lbo5VSzS8TvhD8tJ9CjasQyk6X28ZXrWjegSE KOukttpYyWY9mC8yq1SCxyTfR4b6WtBMLVmn1lZTGvWROUMbfxwanbdVbAzSAazBdwt+ dkjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VTqA5LMN; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e9-20020a17090a4a0900b001df6ce033fasi13260145pjh.57.2022.05.23.10.28.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:28:10 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VTqA5LMN; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 715772189; Mon, 23 May 2022 10:26:02 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240203AbiEWRUV (ORCPT + 99 others); Mon, 23 May 2022 13:20:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240853AbiEWRQp (ORCPT ); Mon, 23 May 2022 13:16:45 -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 A55D669B51; Mon, 23 May 2022 10:16:35 -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 0FFF2B81204; Mon, 23 May 2022 17:13:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BCB9C385AA; Mon, 23 May 2022 17:13:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653326017; bh=tzRz9+4QZigOteXiZvFEjKVlKA33ZGoT+eMajcfxfmU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VTqA5LMN6U1i1EiSrFU/WkqhP8rfHyEKmuIhUwelud1VihtZk47NqvoS1muqikhGM aTy9t1YLUTED6MRV8wPYDl+tZgC/o0epqVVDe5Sz1f/VYOXu5c7SHJMOxUTiqsTrOA JtC8GwzICbJt7lLwrvAr/Lx4Nh5EnhZ+wjUP5Zbo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.4 42/68] net/qla3xxx: Fix a test in ql_reset_work() Date: Mon, 23 May 2022 19:05:09 +0200 Message-Id: <20220523165809.551977508@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165802.500642349@linuxfoundation.org> References: <20220523165802.500642349@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Christophe JAILLET [ Upstream commit 5361448e45fac6fb96738df748229432a62d78b6 ] test_bit() tests if one bit is set or not. Here the logic seems to check of bit QL_RESET_PER_SCSI (i.e. 4) OR bit QL_RESET_START (i.e. 3) is set. In fact, it checks if bit 7 (4 | 3 = 7) is set, that is to say QL_ADAPTER_UP. This looks harmless, because this bit is likely be set, and when the ql_reset_work() delayed work is scheduled in ql3xxx_isr() (the only place that schedule this work), QL_RESET_START or QL_RESET_PER_SCSI is set. This has been spotted by smatch. Fixes: 5a4faa873782 ("[PATCH] qla3xxx NIC driver") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/80e73e33f390001d9c0140ffa9baddf6466a41a2.1652637337.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/qlogic/qla3xxx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c index da2862d59681..5e81cd317a32 100644 --- a/drivers/net/ethernet/qlogic/qla3xxx.c +++ b/drivers/net/ethernet/qlogic/qla3xxx.c @@ -3629,7 +3629,8 @@ static void ql_reset_work(struct work_struct *work) qdev->mem_map_registers; unsigned long hw_flags; - if (test_bit((QL_RESET_PER_SCSI | QL_RESET_START), &qdev->flags)) { + if (test_bit(QL_RESET_PER_SCSI, &qdev->flags) || + test_bit(QL_RESET_START, &qdev->flags)) { clear_bit(QL_LINK_MASTER, &qdev->flags); /* -- 2.35.1