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>
Showing
想要评论请 注册 或 登录