batman-adv: return proper value in case of hash_add failure

In case of hash_add failure tt_global_add() must return 0 (which means on entry
insertion).

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
This commit is contained in:
Antonio Quartulli 2012-08-11 11:11:00 +02:00
parent 30da63a6af
commit c10dba051a
1 changed files with 1 additions and 1 deletions

View File

@ -776,13 +776,13 @@ int batadv_tt_global_add(struct batadv_priv *bat_priv,
batadv_dbg(BATADV_DBG_TT, bat_priv, batadv_dbg(BATADV_DBG_TT, bat_priv,
"Creating new global tt entry: %pM (via %pM)\n", "Creating new global tt entry: %pM (via %pM)\n",
tt_global_entry->common.addr, orig_node->orig); tt_global_entry->common.addr, orig_node->orig);
ret = 1;
out_remove: out_remove:
/* remove address from local hash if present */ /* remove address from local hash if present */
batadv_tt_local_remove(bat_priv, tt_global_entry->common.addr, batadv_tt_local_remove(bat_priv, tt_global_entry->common.addr,
"global tt received", "global tt received",
flags & BATADV_TT_CLIENT_ROAM); flags & BATADV_TT_CLIENT_ROAM);
ret = 1;
out: out:
if (tt_global_entry) if (tt_global_entry)
batadv_tt_global_entry_free_ref(tt_global_entry); batadv_tt_global_entry_free_ref(tt_global_entry);