Browse Source

[netdevice] Fix failure path in register_netdev()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 8 years ago
parent
commit
231adda40f
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      src/net/netdevice.c

+ 2
- 0
src/net/netdevice.c View File

@@ -733,6 +733,8 @@ int register_netdev ( struct net_device *netdev ) {
733 733
 	clear_settings ( netdev_settings ( netdev ) );
734 734
 	unregister_settings ( netdev_settings ( netdev ) );
735 735
  err_register_settings:
736
+	list_del ( &netdev->list );
737
+	netdev_put ( netdev );
736 738
  err_duplicate:
737 739
 	return rc;
738 740
 }

Loading…
Cancel
Save