Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp760202pxb; Tue, 5 Apr 2022 22:07:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyC1hwt+QKPAtkL45rnkjzO9+gepI3cnvCCPoLDgW/udwd0M/c1Pa5OrhrXEUiWjBeYzw8B X-Received: by 2002:a63:b819:0:b0:398:42ff:ed6b with SMTP id p25-20020a63b819000000b0039842ffed6bmr5607492pge.492.1649221660906; Tue, 05 Apr 2022 22:07:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649221660; cv=none; d=google.com; s=arc-20160816; b=xFE7bJ1H/g0wV04xCygTB28A2gqkkgfCWEdNI4zICjnGFMwBepbVG19md7qFootMxT Nm16zbmY66tgaI4I75oJYrDOIJeeOVula+1rIvXmNSLys+8s0dOeBRJz867NzZRfr0NH 9zG1ws+Vlns1KwWeOa9GeU+rC2FxPqCCNLccNGIUz4NNybRlNtNR+r/WOuFDKLQjBSHH aRV0IdiAMbVQWuWeyJHcjNbhPe6q9HWlcj0LlbKUFQmk9Ov/ThQT2CFF0AnRgBnq0EQQ ktXwZeF1r2RJB/U/k0trOC7pIv2bazrpI9UY3/ex4l7nOlLlbnxDaPV17tH84pDPujzw do/w== 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=cn10zOuYk+PiMru09+5aZxPSWrR+lds6ov9+Bc1qsUI=; b=v7yzYKcYFzpvhGLOjxX7FyBvcHnBwprgz6zcGfJSt+BKsjhoHPyZAPsgso4rK6vjqB DoGdNNLb8noobwCSKhi03V27qP4dbzwatKBAr92VvnVRbuhSpjHmLO/mDtiX7Uj8tLGe knOehS8lLAyF6Z6FgMJeek9pe8Kp/pDKaYI7gRSnfgsjwM5zmmem9TquRqDTwiFx7gMC JVtlUKljdsMRDtDzMwbhUs7BIQxrijP0JhZRMCbv8f0WNu03qA6deajr6LuXUAeWG5g1 oZoggMhmlhmCu4wiSkEVBM14AalT73M9WuHFd33VXYj7UNokJRvWs2+Y2hRoXOgVG+k0 KSAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hMWuAaqA; 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 h16-20020a056a001a5000b004fa3a8dffa6si15419002pfv.93.2022.04.05.22.07.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 22:07:40 -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=hMWuAaqA; 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 68E021CB13; Tue, 5 Apr 2022 20:30:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349539AbiDENKp (ORCPT + 99 others); Tue, 5 Apr 2022 09:10:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344194AbiDEJSh (ORCPT ); Tue, 5 Apr 2022 05:18:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 301AB9BADE; Tue, 5 Apr 2022 02:05:19 -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 D3838B818F3; Tue, 5 Apr 2022 09:05:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E542C385A3; Tue, 5 Apr 2022 09:05:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649149516; bh=H+wrthQDzaXAAOeIRN9O2lru9UGFfZdwB03CMg1HSOs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hMWuAaqAWt9rQN92LpAvNUQ+4t7U33QAMWv2sZAc7SpXW0wsXVcdPFz41UPqqXmrC r+3KQKBU7WUC2iSE7P+abOka1raME5QNGShOb51EX08UcWzfPRyWFdds+jk2x7VWGK 26cPmReklCRylZPq1h4NQb1bGAADKXsOdj/op8So= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Rix , "David S. Miller" , Sasha Levin Subject: [PATCH 5.16 0742/1017] octeontx2-af: initialize action variable Date: Tue, 5 Apr 2022 09:27:35 +0200 Message-Id: <20220405070416.288510791@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@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.0 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=no 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: Tom Rix [ Upstream commit 33b5bc9e703383e396f275d51fc4bafa48dbae5a ] Clang static analysis reports this representative issue rvu_npc.c:898:15: warning: Assigned value is garbage or undefined req.match_id = action.match_id; ^ ~~~~~~~~~~~~~~~ The initial setting of action is conditional on if (is_mcam_entry_enabled(...)) The later check of action.op will sometimes be garbage. So initialize action. Reduce setting of *(u64 *)&action = 0x00; to *(u64 *)&action = 0; Fixes: 967db3529eca ("octeontx2-af: add support for multicast/promisc packet replication feature") Signed-off-by: Tom Rix Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- .../net/ethernet/marvell/octeontx2/af/rvu_npc.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index 91f86d77cd41..3a31fb8cc155 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c @@ -605,7 +605,7 @@ void rvu_npc_install_ucast_entry(struct rvu *rvu, u16 pcifunc, struct npc_install_flow_req req = { 0 }; struct npc_install_flow_rsp rsp = { 0 }; struct npc_mcam *mcam = &rvu->hw->mcam; - struct nix_rx_action action; + struct nix_rx_action action = { 0 }; int blkaddr, index; /* AF's and SDP VFs work in promiscuous mode */ @@ -626,7 +626,6 @@ void rvu_npc_install_ucast_entry(struct rvu *rvu, u16 pcifunc, *(u64 *)&action = npc_get_mcam_action(rvu, mcam, blkaddr, index); } else { - *(u64 *)&action = 0x00; action.op = NIX_RX_ACTIONOP_UCAST; action.pf_func = pcifunc; } @@ -657,7 +656,7 @@ void rvu_npc_install_promisc_entry(struct rvu *rvu, u16 pcifunc, struct npc_mcam *mcam = &rvu->hw->mcam; struct rvu_hwinfo *hw = rvu->hw; int blkaddr, ucast_idx, index; - struct nix_rx_action action; + struct nix_rx_action action = { 0 }; u64 relaxed_mask; if (!hw->cap.nix_rx_multicast && is_cgx_vf(rvu, pcifunc)) @@ -685,14 +684,14 @@ void rvu_npc_install_promisc_entry(struct rvu *rvu, u16 pcifunc, blkaddr, ucast_idx); if (action.op != NIX_RX_ACTIONOP_RSS) { - *(u64 *)&action = 0x00; + *(u64 *)&action = 0; action.op = NIX_RX_ACTIONOP_UCAST; } /* RX_ACTION set to MCAST for CGX PF's */ if (hw->cap.nix_rx_multicast && pfvf->use_mce_list && is_pf_cgxmapped(rvu, rvu_get_pf(pcifunc))) { - *(u64 *)&action = 0x00; + *(u64 *)&action = 0; action.op = NIX_RX_ACTIONOP_MCAST; pfvf = rvu_get_pfvf(rvu, pcifunc & ~RVU_PFVF_FUNC_MASK); action.index = pfvf->promisc_mce_idx; @@ -832,7 +831,7 @@ void rvu_npc_install_allmulti_entry(struct rvu *rvu, u16 pcifunc, int nixlf, struct rvu_hwinfo *hw = rvu->hw; int blkaddr, ucast_idx, index; u8 mac_addr[ETH_ALEN] = { 0 }; - struct nix_rx_action action; + struct nix_rx_action action = { 0 }; struct rvu_pfvf *pfvf; u16 vf_func; @@ -861,14 +860,14 @@ void rvu_npc_install_allmulti_entry(struct rvu *rvu, u16 pcifunc, int nixlf, blkaddr, ucast_idx); if (action.op != NIX_RX_ACTIONOP_RSS) { - *(u64 *)&action = 0x00; + *(u64 *)&action = 0; action.op = NIX_RX_ACTIONOP_UCAST; action.pf_func = pcifunc; } /* RX_ACTION set to MCAST for CGX PF's */ if (hw->cap.nix_rx_multicast && pfvf->use_mce_list) { - *(u64 *)&action = 0x00; + *(u64 *)&action = 0; action.op = NIX_RX_ACTIONOP_MCAST; action.index = pfvf->mcast_mce_idx; } -- 2.34.1