net: fix eth device unregistration
We register a device in eth_register, thus we have to unregister it in eth_unregister. Also, if the device we unregister is the current device, we have to set the current eth_device to NULL so that it isn't used anymore. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
4af196ebfc
commit
f3d0cb7f73
|
@ -244,8 +244,11 @@ int eth_register(struct eth_device *edev)
|
|||
|
||||
void eth_unregister(struct eth_device *edev)
|
||||
{
|
||||
dev_remove_parameters(&edev->dev);
|
||||
if (edev == eth_current)
|
||||
eth_current = NULL;
|
||||
|
||||
dev_remove_parameters(&edev->dev);
|
||||
unregister_device(&edev->dev);
|
||||
list_del(&edev->list);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue