]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: dsa: b53: properly bound ARL searches for < 4 ARL bin chips
authorJonas Gorski <jonas.gorski@gmail.com>
Sun, 2 Nov 2025 10:07:58 +0000 (11:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:37:42 +0000 (15:37 -0500)
commit465b77730d75046b94de70e92ec8c146d0d16bba
tree31690dc1938a51a63276a3e57ee5fcf09d2368c4
parenta991025c998cac17996ae84fdfda713518523c60
net: dsa: b53: properly bound ARL searches for < 4 ARL bin chips

[ Upstream commit e57723fe536f040cc2635ec1545dd0a7919a321e ]

When iterating over the ARL table we stop at max ARL entries / 2, but
this is only valid if the chip actually returns 2 results at once. For
chips with only one result register we will stop before reaching the end
of the table if it is more than half full.

Fix this by only dividing the maximum results by two if we have a chip
with more than one result register (i.e. those with 4 ARL bins).

Fixes: cd169d799bee ("net: dsa: b53: Bound check ARL searches")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20251102100758.28352-4-jonas.gorski@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/dsa/b53/b53_common.c