9
0
Fork 0

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:
Sascha Hauer 2012-02-14 22:55:48 +01:00
parent 4af196ebfc
commit f3d0cb7f73
1 changed files with 4 additions and 1 deletions

View File

@ -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);
}