mirror of
https://github.com/ipxe/ipxe
synced 2025-12-14 07:50:43 +03:00
[netdevice] Mark devices as open only if opening succeeds
netdev_close() assumes that devices that are open are on the open_list, which wasn't true if device specific opening failed. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
committed by
Michael Brown
parent
1cc991e132
commit
8ab2f51997
@@ -463,13 +463,13 @@ int netdev_open ( struct net_device *netdev ) {
|
||||
|
||||
DBGC ( netdev, "NETDEV %s opening\n", netdev->name );
|
||||
|
||||
/* Mark as opened */
|
||||
netdev->state |= NETDEV_OPEN;
|
||||
|
||||
/* Open the device */
|
||||
if ( ( rc = netdev->op->open ( netdev ) ) != 0 )
|
||||
return rc;
|
||||
|
||||
/* Mark as opened */
|
||||
netdev->state |= NETDEV_OPEN;
|
||||
|
||||
/* Add to head of open devices list */
|
||||
list_add ( &netdev->open_list, &open_net_devices );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user