1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 09:21:26 +03:00

network: disable event sources before unref them

This commit is contained in:
Yu Watanabe 2021-09-24 17:26:10 +09:00
parent 37eb7108fb
commit d105befc97
2 changed files with 4 additions and 4 deletions

View File

@ -410,7 +410,7 @@ int link_lldp_emit_start(Link *link) {
void link_lldp_emit_stop(Link *link) {
assert(link);
link->lldp_emit_event_source = sd_event_source_unref(link->lldp_emit_event_source);
link->lldp_emit_event_source = sd_event_source_disable_unref(link->lldp_emit_event_source);
}
static const char * const lldp_emit_table[_LLDP_EMIT_MAX] = {

View File

@ -269,7 +269,7 @@ Route *route_free(Route *route) {
ordered_set_free_with_destructor(route->multipath_routes, multipath_route_free);
sd_event_source_unref(route->expire);
sd_event_source_disable_unref(route->expire);
return mfree(route);
}
@ -1261,7 +1261,7 @@ static int route_expire_handler(sd_event_source *s, uint64_t usec, void *userdat
}
static int route_add_and_setup_timer_one(Link *link, const Route *route, const MultipathRoute *m, const NextHop *nh, uint8_t nh_weight, Route **ret) {
_cleanup_(sd_event_source_unrefp) sd_event_source *expire = NULL;
_cleanup_(sd_event_source_disable_unrefp) sd_event_source *expire = NULL;
Route *nr;
int r;
@ -1299,7 +1299,7 @@ static int route_add_and_setup_timer_one(Link *link, const Route *route, const M
return log_link_error_errno(link, r, "Could not arm expiration timer: %m");
}
sd_event_source_unref(nr->expire);
sd_event_source_disable_unref(nr->expire);
nr->expire = TAKE_PTR(expire);
*ret = nr;