From: Antonio Quartulli Date: Sat, 11 Aug 2012 09:11:00 +0000 (+0200) Subject: batman-adv: return proper value in case of hash_add failure X-Git-Tag: v3.8-rc1~139^2~536^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c10dba051a3e287a4f023aaaeffa53fd642cf8c5;p=platform%2Fkernel%2Flinux-3.10.git 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 --- diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index d87d9b4..42a74e3 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, 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);