The following commit has been merged in the merge/master branch: commit 212ec28090c1dc7084980707e16801eab6ca5594 Merge: c5ebb1bf9de9cd4420fa7df3fada088b6a590b73 650d41de4be2fe9e9d1842c1abdd357dedbaa7ba Author: Marek Lindner mareklindner@neomailbox.ch Date: Fri May 6 19:20:39 2016 +0800
Merge branch 'maint' into next
diff --combined net/batman-adv/bat_v.c index 728c9d1,2bcb29b..9e2d129 --- a/net/batman-adv/bat_v.c +++ b/net/batman-adv/bat_v.c @@@ -180,8 -180,8 +180,8 @@@ static void batadv_v_neigh_print(struc struct batadv_hard_iface *hard_iface; int batman_count = 0;
- seq_printf(seq, " %-15s %s (%11s) [%10s]\n", "Neighbor", - "last-seen", "throughput", "IF"); + seq_puts(seq, + " Neighbor last-seen ( throughput) [ IF]\n");
rcu_read_lock(); list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) { @@@ -220,8 -220,9 +220,8 @@@ static void batadv_v_orig_print(struct int batman_count = 0; u32 i;
- seq_printf(seq, " %-15s %s (%11s) %17s [%10s]: %20s ...\n", - "Originator", "last-seen", "throughput", "Nexthop", - "outgoingIF", "Potential nexthops"); + seq_puts(seq, + " Originator last-seen ( throughput) Nexthop [outgoingIF]: Potential nexthops ...\n");
for (i = 0; i < hash->size; i++) { head = &hash->table[i]; @@@ -273,14 -274,23 +273,23 @@@ static int batadv_v_neigh_cmp(struct ba struct batadv_hard_iface *if_outgoing2) { struct batadv_neigh_ifinfo *ifinfo1, *ifinfo2; + int ret = 0;
ifinfo1 = batadv_neigh_ifinfo_get(neigh1, if_outgoing1); + if (WARN_ON(!ifinfo1)) + goto err_ifinfo1; + ifinfo2 = batadv_neigh_ifinfo_get(neigh2, if_outgoing2); + if (WARN_ON(!ifinfo2)) + goto err_ifinfo2;
- if (WARN_ON(!ifinfo1 || !ifinfo2)) - return 0; + ret = ifinfo1->bat_v.throughput - ifinfo2->bat_v.throughput;
- return ifinfo1->bat_v.throughput - ifinfo2->bat_v.throughput; + batadv_neigh_ifinfo_put(ifinfo2); + err_ifinfo2: + batadv_neigh_ifinfo_put(ifinfo1); + err_ifinfo1: + return ret; }
static bool batadv_v_neigh_is_sob(struct batadv_neigh_node *neigh1, @@@ -290,14 -300,26 +299,26 @@@ { struct batadv_neigh_ifinfo *ifinfo1, *ifinfo2; u32 threshold; + bool ret = false;
ifinfo1 = batadv_neigh_ifinfo_get(neigh1, if_outgoing1); + if (WARN_ON(!ifinfo1)) + goto err_ifinfo1; + ifinfo2 = batadv_neigh_ifinfo_get(neigh2, if_outgoing2); + if (WARN_ON(!ifinfo2)) + goto err_ifinfo2;
threshold = ifinfo1->bat_v.throughput / 4; threshold = ifinfo1->bat_v.throughput - threshold;
- return ifinfo2->bat_v.throughput > threshold; + ret = ifinfo2->bat_v.throughput > threshold; + + batadv_neigh_ifinfo_put(ifinfo2); + err_ifinfo2: + batadv_neigh_ifinfo_put(ifinfo1); + err_ifinfo1: + return ret; }
static struct batadv_algo_ops batadv_batman_v __read_mostly = {