aboutsummaryrefslogtreecommitdiffstats
path: root/lib/clz_tab.c
diff options
context:
space:
mode:
authorTom Rix <trix@redhat.com>2022-07-16 17:46:54 -0400
committerJakub Kicinski <kuba@kernel.org>2022-07-18 20:12:04 -0700
commit3696c952da0733b843c8da3441345055b1cbacd9 (patch)
tree91d266fd05ba2f582643d503cacc304e721c6382 /lib/clz_tab.c
parentMerge branch 'net-lan966x-fix-issues-with-mac-table' (diff)
downloadlinux-rng-3696c952da0733b843c8da3441345055b1cbacd9.tar.xz
linux-rng-3696c952da0733b843c8da3441345055b1cbacd9.zip
net: ethernet: mtk_eth_soc: fix off by one check of ARRAY_SIZE
In mtk_wed_tx_ring_setup(.., int idx, ..), idx is used as an index here struct mtk_wed_ring *ring = &dev->tx_ring[idx]; The bounds of idx are checked here BUG_ON(idx > ARRAY_SIZE(dev->tx_ring)); If idx is the size of the array, it will pass this check and overflow. So change the check to >= . Fixes: 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)") Signed-off-by: Tom Rix <trix@redhat.com> Link: https://lore.kernel.org/r/20220716214654.1540240-1-trix@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'lib/clz_tab.c')
0 files changed, 0 insertions, 0 deletions