Move invoking of callout_stop(&lle->lle_timer) into llentry_free().

This deduplicates the code a bit, and also implicitly adds missing
callout_stop() to in[6]_lltable_delete_entry() functions.

PR:		209682, 225927
Submitted by:	hselasky (previous version)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D4605
This commit is contained in:
Andrey V. Elsukov 2018-07-17 11:33:23 +00:00
parent f8c3349737
commit acf673edf0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=336405
3 changed files with 3 additions and 9 deletions

View File

@ -436,6 +436,9 @@ llentry_free(struct llentry *lle)
pkts_dropped = lltable_drop_entry_queue(lle);
/* cancel timer */
if (callout_stop(&lle->lle_timer) > 0)
LLE_REMREF(lle);
LLE_FREE_LOCKED(lle);
return (pkts_dropped);
@ -522,8 +525,6 @@ lltable_free(struct lltable *llt)
IF_AFDATA_WUNLOCK(llt->llt_ifp);
CK_LIST_FOREACH_SAFE(lle, &dchain, lle_chain, next) {
if (callout_stop(&lle->lle_timer) > 0)
LLE_REMREF(lle);
llentry_free(lle);
}

View File

@ -1165,10 +1165,6 @@ in_lltable_free_entry(struct lltable *llt, struct llentry *lle)
lltable_unlink_entry(llt, lle);
}
/* cancel timer */
if (callout_stop(&lle->lle_timer) > 0)
LLE_REMREF(lle);
/* Drop hold queue */
pkts_dropped = llentry_free(lle);
ARPSTAT_ADD(dropped, pkts_dropped);

View File

@ -2135,9 +2135,6 @@ in6_lltable_free_entry(struct lltable *llt, struct llentry *lle)
lltable_unlink_entry(llt, lle);
}
if (callout_stop(&lle->lle_timer) > 0)
LLE_REMREF(lle);
llentry_free(lle);
}