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

From
Jakub Kicinski <kuba@kernel.org>
Date
2026-08-17 23:20:57
Also in
lkml
Reply to
Karl Mehltretter, 2026-08-12
On Wed, 12 Aug 2026 08:07:30 +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.
Applied, thanks!
Thread (4 messages) 4 messages, 4 authors, last reply 2026-08-17
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help