]> git.baikalelectronics.ru Git - kernel.git/commit
net: aquantia: tx clean budget logic error
authorIgor Russkikh <Igor.Russkikh@aquantia.com>
Sat, 25 May 2019 09:57:59 +0000 (09:57 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 May 2019 17:24:13 +0000 (10:24 -0700)
commitc54f36375a71b0e73617793aadb4b4049a7c36e9
treee878870beb2e5bba2dffbfbd4468c6638652c252
parent4a7ade2809580fa345595851619d65f1fca8c684
net: aquantia: tx clean budget logic error

In case no other traffic happening on the ring, full tx cleanup
may not be completed. That may cause socket buffer to overflow
and tx traffic to stuck until next activity on the ring happens.

This is due to logic error in budget variable decrementor.
Variable is compared with zero, and then post decremented,
causing it to become MAX_INT. Solution is remove decrementor
from the `for` statement and rewrite it in a clear way.

Fixes: 0e247a6c4f487 ("net: aquantia: Add tx clean budget and valid budget handling logic")
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/aquantia/atlantic/aq_ring.c