Skip to content
Commit 5cc1f24f authored by Baruch Siach's avatar Baruch Siach Committed by Greg Kroah-Hartman
Browse files

net: stmmac: fix rx budget limit check

[ Upstream commit fa02de9e ]

The while loop condition verifies 'count < limit'. Neither value change
before the 'count >= limit' check. As is this check is dead code. But
code inspection reveals a code path that modifies 'count' and then goto
'drain_data' and back to 'read_again'. So there is a need to verify
count value sanity after 'read_again'.

Move 'read_again' up to fix the count limit check.

Fixes: ec222003

 ("net: stmmac: Prepare to add Split Header support")
Signed-off-by: default avatarBaruch Siach <baruch@tkos.co.il>
Reviewed-by: default avatarSerge Semin <fancer.lancer@gmail.com>
Link: https://lore.kernel.org/r/d9486296c3b6b12ab3a0515fcd47d56447a07bfc.1699897370.git.baruch@tkos.co.il
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent c4b712d1
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment