On Wednesday 30 October 2013 15:01:47 Simon Wunderlich wrote:
@@ -1559,7 +1661,12 @@ static void batadv_iv_ogm_orig_print(struct batadv_priv *bat_priv, if (!neigh_node) continue;
if (neigh_node->bat_iv.tq_avg == 0)
n_ifinfo = batadv_neigh_ifinfo_get(neigh_node,
BATADV_IF_DEFAULT);
if (!n_ifinfo)
goto next;
if (n_ifinfo->bat_iv.tq_avg == 0) goto next; last_seen_jiffies = jiffies - orig_node->last_seen;
@@ -1569,17 +1676,12 @@ static void batadv_iv_ogm_orig_print(struct batadv_priv *bat_priv,
seq_printf(seq, "%pM %4i.%03is (%3i) %pM [%10s]:", orig_node->orig, last_seen_secs,
last_seen_msecs, neigh_node->bat_iv.tq_avg,
last_seen_msecs, n_ifinfo->bat_iv.tq_avg, neigh_node->addr, neigh_node->if_incoming->net_dev->name);
hlist_for_each_entry_rcu(neigh_node_tmp,
&orig_node->neigh_list, list) {
seq_printf(seq, " %pM (%3i)",
neigh_node_tmp->addr,
neigh_node_tmp->bat_iv.tq_avg);
}
batadv_iv_ogm_orig_print_neigh(orig_node,
BATADV_IF_DEFAULT, seq); seq_puts(seq, "\n"); batman_count++;
Aren't we missing a free_ref(n_ifinfo) here ?
+/**
- batadv_neigh_node_free_ref - decrement the neighbors refcounter
- and possibly free it
- neigh_node: neigh neighbor to free
- */
void batadv_neigh_node_free_ref(struct batadv_neigh_node *neigh_node) { if (atomic_dec_and_test(&neigh_node->refcount))
kfree_rcu(neigh_node, rcu);
call_rcu(&neigh_node->rcu, batadv_neigh_node_free_rcu);
}
Isn't there some compat code you can remove as well ?
Cheers, Marek