diff options
author | Michael Brown | 2010-09-02 04:34:04 +0200 |
---|---|---|
committer | Michael Brown | 2010-09-03 22:28:43 +0200 |
commit | 28934eef81b3c7a494b12cb87804098041d64659 (patch) | |
tree | da46f478f9977bca4c06f5e71dc37a0066948237 /src/net/aoe.c | |
parent | [process] Add process_running() (diff) | |
download | ipxe-28934eef81b3c7a494b12cb87804098041d64659.tar.gz ipxe-28934eef81b3c7a494b12cb87804098041d64659.tar.xz ipxe-28934eef81b3c7a494b12cb87804098041d64659.zip |
[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>
Diffstat (limited to 'src/net/aoe.c')
-rw-r--r-- | src/net/aoe.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net/aoe.c b/src/net/aoe.c index 4a03e2b6..5e1a3b5b 100644 --- a/src/net/aoe.c +++ b/src/net/aoe.c @@ -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; |