Thread (4 messages) flat view 4 messages, 4 authors, 6h ago

Re: [PATCH net] octeontx2-af: initialize lmac_bmap in rvu_mcs_set_lmac_bmap()

From: Ratheesh Kannoth <rkannoth@marvell.com>
Date: 2026-08-12 06:33:18
Also in: lkml

On 2026-08-12 at 11:37:30, Karl Mehltretter (kmehltretter@gmail.com) wrote:
rvu_mcs_set_lmac_bmap() declares lmac_bmap without initializing it and
only sets bits for valid lmacs with set_bit(), which ORs into the word
without clearing it first. Bits for invalid or skipped ports keep
whatever was on the stack, and the garbage is stored into
mcs->hw->lmac_bmap.

Initialize lmac_bmap to 0 so only valid lmacs are marked.

Found with Clang's -Wconditional-uninitialized.

Fixes: ca7f49ff8846 ("octeontx2-af: cn10k: Introduce driver for macsec block.")
Assisted-by: Claude:claude-fable-5
Signed-off-by: Karl Mehltretter <redacted>
Thank you.

Reviewed-by: Ratheesh Kannoth <rkannoth@marvell.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help