diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 9f61797c6492..6c65d195f375 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -1526,13 +1526,12 @@ u16 batadv_tt_local_remove(struct batadv_priv *bat_priv, const u8 *addr, bool roaming) { struct batadv_tt_local_entry *tt_local_entry; - u16 curr_flags = BATADV_NO_FLAGS; - bool pending = false; + u16 curr_flags; u16 flags; tt_local_entry = batadv_tt_local_hash_find(bat_priv, addr, vid); if (!tt_local_entry) - goto out; + return BATADV_NO_FLAGS; flags = BATADV_TT_CLIENT_DEL; /* if this global entry addition is due to a roaming, the node has to @@ -1542,20 +1541,15 @@ u16 batadv_tt_local_remove(struct batadv_priv *bat_priv, const u8 *addr, if (roaming) flags |= BATADV_TT_CLIENT_ROAM; - pending = batadv_tt_local_mark_removed(tt_local_entry, roaming, - &curr_flags); - if (pending) { - batadv_tt_local_set_pending_event(bat_priv, tt_local_entry, flags, - message); - goto out; - } + if (batadv_tt_local_mark_removed(tt_local_entry, roaming, &curr_flags)) + batadv_tt_local_set_pending_event(bat_priv, tt_local_entry, + flags, message); + else + /* if this client has been added right now, it is possible to + * immediately purge it + */ + batadv_tt_local_remove_now(bat_priv, tt_local_entry); - /* if this client has been added right now, it is possible to - * immediately purge it - */ - batadv_tt_local_remove_now(bat_priv, tt_local_entry); - -out: batadv_tt_local_entry_put(tt_local_entry); return curr_flags;