mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
eth: remove usb-ethernet devices before re-enumerating them
Fix the crash when running several times usb_init() with a USB ethernet device plugged. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Tested-by: Wolfgang Grandegger <wg@denx.de>
This commit is contained in:
parent
e159e4868e
commit
e7e982d69c
3 changed files with 35 additions and 2 deletions
|
@ -127,8 +127,11 @@ int usb_host_eth_scan(int mode)
|
|||
|
||||
old_async = usb_disable_asynch(1); /* asynch transfer not allowed */
|
||||
|
||||
for (i = 0; i < USB_MAX_ETH_DEV; i++)
|
||||
memset(&usb_eth[i], 0, sizeof(usb_eth[i]));
|
||||
/* unregister a previously detected device */
|
||||
for (i = 0; i < usb_max_eth_dev; i++)
|
||||
eth_unregister(&usb_eth[i].eth_dev);
|
||||
|
||||
memset(usb_eth, 0, sizeof(usb_eth));
|
||||
|
||||
for (i = 0; prob_dev[i].probe; i++) {
|
||||
if (prob_dev[i].before_probe)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue