提交 68acb51f 编写于 作者: J Joe Hershberger

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: NJoe Hershberger <joe.hershberger@ni.com>
Reviewed-by: NSimon Glass <sjg@chromium.org>
上级 c6fa51a4
......@@ -307,7 +307,7 @@ void eth_halt(void)
struct eth_device_priv *priv;
current = eth_get_dev();
if (!current || !device_active(current))
if (!current || !eth_is_active(current))
return;
eth_get_ops(current)->stop(current);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册