batman-adv: Fix lock for ogm cnt access in batadv_iv_ogm_calc_tq
authorSven Eckelmann <sven@narfation.org>
Sun, 3 Dec 2017 10:26:45 +0000 (11:26 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 3 Mar 2018 15:50:43 +0000 (15:50 +0000)
commit5fb4659d868bde00243997ea6f095e7373c4a21a
treee40bbdc229f15ddc17a9b92735513f6f147b65c6
parent3459f7bd556193aed0d55cb1006374d1409041eb
batman-adv: Fix lock for ogm cnt access in batadv_iv_ogm_calc_tq

commit 5ba7dcfe77037b67016263ea597a8b431692ecab upstream.

The originator node object orig_neigh_node is used to when accessing the
bcast_own(_sum) and real_packet_count information. The access to them has
to be protected with the spinlock in orig_neigh_node.

But the function uses the lock in orig_node instead. This is incorrect
because they could be two different originator node objects.

Fixes: 0ede9f41b217 ("batman-adv: protect bit operations to count OGMs with spinlock")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
[bwh: Backported to 3.2:
 - s/bat_iv\.ogm_cnt_lock/ogm_cnt_lock/
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/batman-adv/bat_iv_ogm.c