Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3683998lfo; Mon, 23 May 2022 11:20:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy38A7xcsXc5OKSKz2KOcWXSVaEDaOwBJM9aaPE1QJB2CMjp5Dsh9fquaAzISJROt+MOepn X-Received: by 2002:a63:bf07:0:b0:3f5:dca9:d200 with SMTP id v7-20020a63bf07000000b003f5dca9d200mr20742902pgf.530.1653330028056; Mon, 23 May 2022 11:20:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653330028; cv=none; d=google.com; s=arc-20160816; b=tH3vBCejjOkKVjqxHU+gDvnItzil5Yn9TWwrjg7kWCDroYNxqCaONX6/gpiJspg99m hNMgfJcqxVztliuhtsH1fxCmvW50xChH2xcd/0UaXNBzIgz3nY/3jCX21HZpQw/Dgqon DKm0E3KBvMdEogoE6iqJ59iWzK1hLJgzPUnst5j1djhDd7JqtjRH83BB4Wupw2JJyg+r GK/o9HCKlJ62bxC7Gt5/ELIRvePEy4fmT9fYyOUt1K+kaOUySNueJgx+MmxMRR0AHh1v fZacQ+0c3okbulAcCNFsznV4Q17vH2A5yX4Zggn3Ud1tsvc6ZQwznts706fmgYuzV2xR N6mA== 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=fbRLyOstb1uUCSEfnA8fAQAHBcI82GI4n2iNoxMKcM4=; b=V3BnFgW4Isk2IqUWuDyEBJJoiXjzwqubPDsoC2UO9gXYG4DENLzjEjP+KmxLaQyoec XUdyGB5wlZ2ohNiOePbKju1O0HVJGpU29eraOtPOy2BmeIXAFsFfG1nnySyCk4EOBwyw fZvpArwGt7OgSMQAzrK9tPmUZSqa6CjpuLfJvbCwKJ6tv/ayhaSZ1OWHbssyIHZy8z52 zpPKwIFWA31u6ybCPH2ecv8tuNmwDAf2cXlQ4j+hAzovnWA/WY4Jc6x+2KB80A0ev3Fx kRjE91eLO8lhvsf61gmrI68aAmyh60Q6GguG4t3wwpndGXeXYbMiAtPZBL/jsGVZ0NtQ t0rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Rc85mjTa; 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 z15-20020a655a4f000000b003db97293633si12294785pgs.184.2022.05.23.11.20.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 11:20:28 -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=Rc85mjTa; 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 36E3B179944; Mon, 23 May 2022 11:20:08 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243081AbiEWSNy (ORCPT + 99 others); Mon, 23 May 2022 14:13:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243840AbiEWRvt (ORCPT ); Mon, 23 May 2022 13:51:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 141DE63531; Mon, 23 May 2022 10:38: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 2FFAC60BD3; Mon, 23 May 2022 17:30:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37859C385AA; Mon, 23 May 2022 17:30:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653327033; bh=Qr88KDm+8w4ttAVeAg2P+FcF1zwbfkMRYuL+cGuyPro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rc85mjTaRL3AkTF2pO60q1i/ba71ShS+3n0CY2laCYnsb01DD0JCXRB1zPsHxOKXv GE47p3w3zm7t4z2sYflPIsB962nOq2vh7c22LxjPw2CaYfnWayjmCxGCsylBE2G1Mi 4hACxPUzdTjg58TRJC+WHhJPTGBy4RIKDXUnQgNA= 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.17 100/158] net/qla3xxx: Fix a test in ql_reset_work() Date: Mon, 23 May 2022 19:04:17 +0200 Message-Id: <20220523165847.975129356@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165830.581652127@linuxfoundation.org> References: <20220523165830.581652127@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 b30589a135c2..06f4d9a9e938 100644 --- a/drivers/net/ethernet/qlogic/qla3xxx.c +++ b/drivers/net/ethernet/qlogic/qla3xxx.c @@ -3614,7 +3614,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