batman-adv: Fix lock for ogm cnt access in batadv_iv_ogm_calc_tq
authorSven Eckelmann <sven@narfation.org>
Mon, 16 Mar 2020 22:30:52 +0000 (23:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Mar 2020 08:07:53 +0000 (09:07 +0100)
commit13e6a853099e054909aa5baa1364b834052efe96
treee35017bde6da3e9b2a33b1f3ffcb3b557e177272
parent8c69c09f5ede7b40f0d5bc1c12d4880bdc30d9d9
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/batman-adv/bat_iv_ogm.c