mirror of
https://github.com/ipxe/ipxe
synced 2025-12-19 02:50:25 +03:00
[retry] Hold reference while timer is running and during expiry callback
Guarantee that a retry timer cannot go out of scope while the timer is running, and provide a guarantee to the expiry callback that the timer will remain in scope during the entire callback (similar to the guarantee provided to interface methods). Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -439,7 +439,7 @@ int aoe_attach ( struct ata_device *ata, struct net_device *netdev,
|
||||
if ( ! aoe )
|
||||
return -ENOMEM;
|
||||
ref_init ( &aoe->refcnt, aoe_free );
|
||||
timer_init ( &aoe->timer, aoe_timer_expired );
|
||||
timer_init ( &aoe->timer, aoe_timer_expired, &aoe->refcnt );
|
||||
aoe->netdev = netdev_get ( netdev );
|
||||
memcpy ( aoe->target, netdev->ll_broadcast, sizeof ( aoe->target ) );
|
||||
aoe->tag = AOE_TAG_MAGIC;
|
||||
|
||||
Reference in New Issue
Block a user