]> git.baikalelectronics.ru Git - uboot.git/commit
net: Protect net_state from reentrant net_loop()
authorLeonid Iziumtsev <leonid.iziumtsev@gmail.com>
Tue, 8 May 2018 13:55:50 +0000 (15:55 +0200)
committerJoe Hershberger <joe.hershberger@ni.com>
Wed, 13 Jun 2018 18:54:16 +0000 (13:54 -0500)
commit33957dce04a4ee47997d2ff409a641599383f75a
tree87969872714b7b73deba1551e68b9d207608a047
parent379d9b4436e6e0db186e46c0089eae3e49b6702a
net: Protect net_state from reentrant net_loop()

Global variable "net_state" is used in net_loop() state-machine.
But it happens that some times the net_loop() can be called
multiple times in the same call stack. For example when the
netconsole is enabled and we print the message while some other
net protocol is in action. Netconsole will overwrite the "net_state"
and that will break the logic for earlier started protocol.

To protect the state save and restore "net_state" variable each
time when we enter and exit net_loop().

Signed-off-by: Leonid Iziumtsev <leonid.iziumtsev@se.atlascopco.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
net/net.c