# Re: \[PATCH net\] octeontx2-af: initialize lmac\_bmap in rvu\_mcs\_set\_lmac\_bmap()

- From: Simon Horman \<horms@kernel.org\>
- Date: 2026-08-14 09:10:57 
- List: netdev
- Page: https://ratatoskr.run/netdev/2026/08/17411766
- Thread: https://ratatoskr.run/netdev/2026/08/17400089/t.md

```text
On Wed, Aug 12, 2026 at 08:07:30AM +0200, Karl Mehltretter 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>

Reviewed-by: Simon Horman <horms@kernel.org>

```
