Skip to content

Commit d853f1d

Browse files
Colin Ian Kingdavem330
authored andcommitted
octeontx2-af: Fix uninitialized variable val
In the case where the condition !is_rvu_otx2(rvu) is false variable val is not initialized and can contain a garbage value. Fix this by initializing val to zero and bit-wise or'ing in BIT_ULL(51) to val for the true condition case of !is_rvu_otx2(rvu). Addresses-Coverity: ("Uninitialized scalar variable") Fixes: 4b5a3ab ("octeontx2-af: Hardware configuration for inline IPsec") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6042d43 commit d853f1d

File tree

1 file changed

+2
-1
lines changed
  • drivers/net/ethernet/marvell/octeontx2/af

1 file changed

+2
-1
lines changed

drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4596,9 +4596,10 @@ static void nix_inline_ipsec_cfg(struct rvu *rvu, struct nix_inline_ipsec_cfg *r
45964596

45974597
cpt_idx = (blkaddr == BLKADDR_NIX0) ? 0 : 1;
45984598
if (req->enable) {
4599+
val = 0;
45994600
/* Enable context prefetching */
46004601
if (!is_rvu_otx2(rvu))
4601-
val = BIT_ULL(51);
4602+
val |= BIT_ULL(51);
46024603

46034604
/* Set OPCODE and EGRP */
46044605
val |= FIELD_PREP(IPSEC_GEN_CFG_EGRP, req->gen_cfg.egrp);

0 commit comments

Comments
 (0)