]> git.baikalelectronics.ru Git - kernel.git/commit
batman-adv: Only put gw_node list reference when removed
authorSven Eckelmann <sven@narfation.org>
Sun, 31 Jan 2016 12:27:59 +0000 (13:27 +0100)
committerAntonio Quartulli <a@unstable.cc>
Tue, 16 Feb 2016 09:52:25 +0000 (17:52 +0800)
commit3c5e1c5d87263096a412efc3a368e94d965793a3
tree6ae1d405b2ed725cc1dff31138576a024712f612
parent8571dd4175a3e4cdabea17daa80b19d7e352d541
batman-adv: Only put gw_node list reference when removed

The batadv_gw_node reference counter in batadv_gw_node_update can only be
reduced when the list entry was actually removed. Otherwise the reference
counter may reach zero when batadv_gw_node_update is called from two
different contexts for the same gw_node but only one context is actually
removing the entry from the list.

The release function for this gw_node is not called inside the list_lock
spinlock protected region because the function batadv_gw_node_update still
holds a gw_node reference for the object pointer on the stack. Thus the
actual release function (when required) will be called only at the end of
the function.

Fixes: 1c17b02578e1 ("batman-adv: remove obsolete deleted attribute for gateway node")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
net/batman-adv/gateway_client.c