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)
commit31bafc49a7736989e4c2d9f7280002c66536e590
treee878870beb2e5bba2dffbfbd4468c6638652c252
parent3e66b7cc50ef921121babc91487e1fb98af1ba6e
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: b647d3980948e ("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