mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] octeontx2-af: fix uninitialized variable
@ 2021-09-20 16:53 trix
  2021-09-20 22:22 ` Nick Desaulniers
  0 siblings, 1 reply; 3+ messages in thread
From: trix @ 2021-09-20 16:53 UTC (permalink / raw)
  To: sgoutham, lcherian, gakula, jerinj, hkelam, sbhatta, davem, kuba,
	nathan, ndesaulniers, schalla, vvelumuri
  Cc: netdev, linux-kernel, llvm, Tom Rix

From: Tom Rix <trix@redhat.com>

Building with clang 13 reports this error
rvu_nix.c:4600:7: error: variable 'val' is used uninitialized whenever
  'if' condition is false
                if (!is_rvu_otx2(rvu))
                    ^~~~~~~~~~~~~~~~~

So initialize val.

Fixes: 4b5a3ab17c6c ("octeontx2-af: Hardware configuration for inline IPsec")
Signed-off-by: Tom Rix <trix@redhat.com>
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
index ea3e03fa55d45c..70431db866b328 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
@@ -4592,7 +4592,7 @@ static void nix_inline_ipsec_cfg(struct rvu *rvu, struct nix_inline_ipsec_cfg *r
 				 int blkaddr)
 {
 	u8 cpt_idx, cpt_blkaddr;
-	u64 val;
+	u64 val = 0;
 
 	cpt_idx = (blkaddr == BLKADDR_NIX0) ? 0 : 1;
 	if (req->enable) {
-- 
2.26.3


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-21  2:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-20 16:53 [PATCH] octeontx2-af: fix uninitialized variable trix
2021-09-20 22:22 ` Nick Desaulniers
2021-09-20 23:08   ` Tom Rix

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome