Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2108561ioo; Mon, 23 May 2022 10:13:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSfoK8+DreLp6vZcF8/bwzmLUQA+65X/87MkOlb4P1WMfnsFtNitWtV4BIt+SIeJPDbMQT X-Received: by 2002:a17:902:7289:b0:161:d78a:9e14 with SMTP id d9-20020a170902728900b00161d78a9e14mr23505789pll.88.1653326035224; Mon, 23 May 2022 10:13:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653326035; cv=none; d=google.com; s=arc-20160816; b=EjmSJYTOyzxvPJy2GOWYNybMBB7w5fqBXdwCmFyhLHtpSLksQJ93holYLk8JaZsNzQ 0WuZ91wkxm8wQlzrSpT44Z8KcZS4oHC13T8mZpBfFng5YNvLvVwxUrRhVdqvw+MnZVcM lluuj3zaPFsUUUUWYkQQgHdiU4fHIVMGbtR1KO0FE4Rp3/tz8Cz9Ng9OhcJ+qgJjVKYw PCnF2Ju6T9XpTDFfhiuAYLbPYYA1ZwhgPj0EzRL8RoQ+r416hw0ys8YA5rdD7q8qoUou mpOvBVzH322OO5vLuP+Yo0hjdk+iarlYucTsv9Wn8SjzHI9QXLDSXVomrgcD7OhY0pDb a10Q== 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=84DLxIqTZ32lh8xMe4slqXkg9QiBxWLnHtRjsyvZkSw=; b=BTijmU1iqrjjjmypL5jv1WIKbaOQyKPLdNVC5U6MC1LjbEY3MzDXcrg4pY+WkKqRWA An4p+CDrKVFH2iP9CiWVoyunihxP7DfiyDCpBo0SRemSlzZtpYs7zKAVApYdRLBgQ558 558yMGE9Y7vv8BiRN2Oc3SogOhiavgnq0deSQNGC/9tXMrcDdo1MEZuL6dV8bk9E2D69 sWSasCy87aSjYKIe/X/GNNLJoW3308OHuiEXADNTAhT+B2ssIToMoI1IuE3PymyCpJEi lqTCgz3Vqhs6wOT4zVvdsGTgU7kf7wDy8+2qtwn15vLn0YGmXOFtq105GuKfYocelNqn nu3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xq70TMYl; 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 21-20020a630115000000b003fa0ae4f59fsi8777253pgb.52.2022.05.23.10.13.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:13:55 -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=xq70TMYl; 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 out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 83E6B6EB12; Mon, 23 May 2022 10:13:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240413AbiEWRMQ (ORCPT + 99 others); Mon, 23 May 2022 13:12:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239577AbiEWRKE (ORCPT ); Mon, 23 May 2022 13:10:04 -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 A72466CABA; Mon, 23 May 2022 10:09:45 -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 DE331B81201; Mon, 23 May 2022 17:09:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 094DBC385AA; Mon, 23 May 2022 17:09:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653325769; bh=5jhTzv1tXdLg5gn1SaUB3V7Al5kukdCxzi/6c+9V9go=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xq70TMYl77G9wl/zvtQ8k1x7utsvUKjZG+RHMP7MqfNc/NAGlPYc8R3YkJ8jEJHiO +0LWE7DTkqwgl/FYJHTaQgAgZtzoigklOJi3mW+KsFGOBLHxhxHJHGGOKujCGY8L+S yBje9ldSTGVe4s4cAxLYGhuiHnVseRZWvVyYpC5g= 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 4.14 17/33] net/qla3xxx: Fix a test in ql_reset_work() Date: Mon, 23 May 2022 19:05:06 +0200 Message-Id: <20220523165750.768280085@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165746.957506211@linuxfoundation.org> References: <20220523165746.957506211@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 ecd345ca160f..9d384fb3b746 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