diff options
author | Antonio Quartulli <ordex@autistici.org> | 2012-08-11 05:11:00 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-10-29 04:42:31 -0400 |
commit | c10dba051a3e287a4f023aaaeffa53fd642cf8c5 (patch) | |
tree | 305c89c8b4cda203770f9b4c3a513e4c83c5a928 /net | |
parent | 30da63a6af1dbf60e6d989faa4b984b1c6c9dfaf (diff) |
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/batman-adv/translation-table.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index d87d9b44ee4f..42a74e31b4ab 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c | |||
@@ -776,13 +776,13 @@ int batadv_tt_global_add(struct batadv_priv *bat_priv, | |||
776 | batadv_dbg(BATADV_DBG_TT, bat_priv, | 776 | batadv_dbg(BATADV_DBG_TT, bat_priv, |
777 | "Creating new global tt entry: %pM (via %pM)\n", | 777 | "Creating new global tt entry: %pM (via %pM)\n", |
778 | tt_global_entry->common.addr, orig_node->orig); | 778 | tt_global_entry->common.addr, orig_node->orig); |
779 | ret = 1; | ||
779 | 780 | ||
780 | out_remove: | 781 | out_remove: |
781 | /* remove address from local hash if present */ | 782 | /* remove address from local hash if present */ |
782 | batadv_tt_local_remove(bat_priv, tt_global_entry->common.addr, | 783 | batadv_tt_local_remove(bat_priv, tt_global_entry->common.addr, |
783 | "global tt received", | 784 | "global tt received", |
784 | flags & BATADV_TT_CLIENT_ROAM); | 785 | flags & BATADV_TT_CLIENT_ROAM); |
785 | ret = 1; | ||
786 | out: | 786 | out: |
787 | if (tt_global_entry) | 787 | if (tt_global_entry) |
788 | batadv_tt_global_entry_free_ref(tt_global_entry); | 788 | batadv_tt_global_entry_free_ref(tt_global_entry); |