Skip to content
Snippets Groups Projects
Commit 68acb51f authored by Joe Hershberger's avatar Joe Hershberger
Browse files

net: Only call halt on a driver that has been init'ed


With driver model, we were not checking if the state of the device was
marked as active before calling the halt function. Check that the device
is probed and also marked as active. This avoids the case where we were
calling halt on the first device in net_init() and the driver would
operate on bogus data structures causing problems. In this case, the
priv was all 0, so halt() would close STDIN.

Signed-off-by: default avatarJoe Hershberger <joe.hershberger@ni.com>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
parent c6fa51a4
No related branches found
No related tags found
No related merge requests found
...@@ -307,7 +307,7 @@ void eth_halt(void) ...@@ -307,7 +307,7 @@ void eth_halt(void)
struct eth_device_priv *priv; struct eth_device_priv *priv;
current = eth_get_dev(); current = eth_get_dev();
if (!current || !device_active(current)) if (!current || !eth_is_active(current))
return; return;
eth_get_ops(current)->stop(current); eth_get_ops(current)->stop(current);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment