Skip to content

Commit

Permalink
batman-adv: return proper value in case of hash_add failure
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Antonio Quartulli committed Oct 29, 2012
1 parent 30da63a commit c10dba0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/batman-adv/translation-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,13 +776,13 @@ int batadv_tt_global_add(struct batadv_priv *bat_priv,
batadv_dbg(BATADV_DBG_TT, bat_priv,
"Creating new global tt entry: %pM (via %pM)\n",
tt_global_entry->common.addr, orig_node->orig);
ret = 1;

out_remove:
/* remove address from local hash if present */
batadv_tt_local_remove(bat_priv, tt_global_entry->common.addr,
"global tt received",
flags & BATADV_TT_CLIENT_ROAM);
ret = 1;
out:
if (tt_global_entry)
batadv_tt_global_entry_free_ref(tt_global_entry);
Expand Down

0 comments on commit c10dba0

Please sign in to comment.