提交 c10dba05 编写于 作者: A Antonio Quartulli

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: NAntonio Quartulli <ordex@autistici.org>
上级 30da63a6
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册