The following commit has been merged in the merge/master branch: commit 3668e7c4890ed2e9b5958396aa714f9938f1444d Merge: 643527765b28a1f5756bf2bf8d7ecd0a09771975 212ec28090c1dc7084980707e16801eab6ca5594 Author: Marek Lindner mareklindner@neomailbox.ch Date: Fri May 6 19:22:20 2016 +0800
Merge branch 'next'
diff --combined net/batman-adv/bat_v.c index 927d405,9e2d129..b52d684 --- a/net/batman-adv/bat_v.c +++ b/net/batman-adv/bat_v.c @@@ -108,6 -108,14 +108,6 @@@ batadv_v_hardif_neigh_init(struct batad batadv_v_elp_throughput_metric_update); }
-static void batadv_v_ogm_schedule(struct batadv_hard_iface *hard_iface) -{ -} - -static void batadv_v_ogm_emit(struct batadv_forw_packet *forw_packet) -{ -} - /** * batadv_v_orig_print_neigh - print neighbors for the originator table * @orig_node: the orig_node for which the neighbors are printed @@@ -265,14 -273,23 +265,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, @@@ -282,14 -299,26 +291,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 = { @@@ -300,6 -329,8 +321,6 @@@ .bat_iface_update_mac = batadv_v_iface_update_mac, .bat_primary_iface_set = batadv_v_primary_iface_set, .bat_hardif_neigh_init = batadv_v_hardif_neigh_init, - .bat_ogm_emit = batadv_v_ogm_emit, - .bat_ogm_schedule = batadv_v_ogm_schedule, .bat_orig_print = batadv_v_orig_print, .bat_neigh_cmp = batadv_v_neigh_cmp, .bat_neigh_is_similar_or_better = batadv_v_neigh_is_sob,