Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2112108ioo; Mon, 23 May 2022 10:18:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6I+pK3S/mBtM95+aUVl2b+SaziVl445KG1Q591YqvRpDqXJVScQJSr9iz4bxeTr/+2/ZZ X-Received: by 2002:a17:90b:4c8a:b0:1df:dedb:8bb6 with SMTP id my10-20020a17090b4c8a00b001dfdedb8bb6mr75434pjb.6.1653326302844; Mon, 23 May 2022 10:18:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653326302; cv=none; d=google.com; s=arc-20160816; b=LQ4QTS1lZ1ftX7/uJ2eujwfDc/EozcOU2hLDypZ9C2V3Zqw7cMBp9Zivwt9cua1m1+ vmlJqROGRSt0A4WIwjKThvAzIIyLXdeMPzAc189DepPKmQzhrmH3ERVZwSP0pU41cUF+ i7RLdhBg7+L2avlbkV1uJPImUOvBUawnibgoaZA+JTrweTzC+KgKwOxxPtNCvAqxVre5 SXRQnkl6Ggxj5b2UyjPpdUunBNaw+z1bqePadGzofOPeBY8MPe+c3dIL2+odONdZDZjt +uowyRUTh/vTHJPophfdgIwl4rxn4Z8rJ6Dix3NJ7W3nBh/i/ZpAq6rIBcd0swJvv5NT 7Cmw== 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=f0tUlLPirfCbKtCcBZ9iC2YclIhz5dQ1v7FM5KU3ZmI=; b=z6OpStNSBpLsvWPa7bjr27LxONxUOBrpxDXAX6vADf4WOKSIRNzFUVPbFgsfSYOJaR 9DgDWRRS4PJFcURejtIPqN1FGfIX9ftXBvf1cub4y/Lw+glw0AQrhJpV+xknx8DbvYVQ nKWdwwBa/7d4RzGaOb44NSNkSItEo8TcHEfPvtv9lrd1LwO/gk9QVe7MT4sCab/ngqaT 9YvqWWBBtXSLlYjwk6ZFsRJHlXScJWnNqKtewXxEpLGkUWQ0AqDts0cpK+hFWxmRqWyM tMlGXBN3eqRC6OnW6dfMVsSS9OjK4ZTrpQl95MtubweZBASieGBLj6MdvkQ/WRkUB4bO OTRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kOAkkBj1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u14-20020a17090341ce00b0015caeda8720si11982550ple.106.2022.05.23.10.18.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:18:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kOAkkBj1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 6E50775211; Mon, 23 May 2022 10:18:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240676AbiEWRQj (ORCPT + 99 others); Mon, 23 May 2022 13:16:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239869AbiEWRL1 (ORCPT ); Mon, 23 May 2022 13:11:27 -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 22A366C0ED; Mon, 23 May 2022 10:10:36 -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 CE148614CC; Mon, 23 May 2022 17:10:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC3A8C385A9; Mon, 23 May 2022 17:10:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653325835; bh=80sJ6aoPLSK5bKbKiQJt0oOm15w8d5jnoJv4dReW0fs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kOAkkBj1OV0uekFAQU4hUI0R72BhIG5eObWHp+mT833EEyy76/2Fm3W1xU08GEmWd YB6Z/yjmaIGY4Arn6NzxUZOYPJW0LlwxsNzMxayg1XNupXLLY6koxLkaVEjr9Y3YHl RRLSdHc58emDatwnhB5KFZ875myjOF/r+os2QTSI= 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.19 26/44] net/qla3xxx: Fix a test in ql_reset_work() Date: Mon, 23 May 2022 19:05:10 +0200 Message-Id: <20220523165757.899822345@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165752.797318097@linuxfoundation.org> References: <20220523165752.797318097@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 f38dda1d92e2..51e17a635d4b 100644 --- a/drivers/net/ethernet/qlogic/qla3xxx.c +++ b/drivers/net/ethernet/qlogic/qla3xxx.c @@ -3630,7 +3630,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