batman-adv: Use kref_get for hard_iface subfunctions
authorSven Eckelmann <sven@narfation.org>
Mon, 11 Apr 2016 11:06:40 +0000 (13:06 +0200)
committerAntonio Quartulli <a@unstable.cc>
Tue, 10 May 2016 10:28:29 +0000 (18:28 +0800)
commit17a8691502c9d2d792cfea7253b17382279ffb3e
tree6b2f476a17ff8d70d72caf5f6fbedc5b4bf7406d
parentc3ba37a778ecab4f8ddb117a2ceff3e13184a7db
batman-adv: Use kref_get for hard_iface subfunctions

The callers of the functions using batadv_hard_iface objects already make
sure that they hold a valid reference. The subfunctions don't have
to check whether the reference counter is > 0 because this was checked by
the callers.

The kref_get function instead WARNs (with debug information) when the
reference counter would still be 0. This makes a bug in batman-adv better
visible because kref_get_unless_zero would have ignored this problem.

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/bat_iv_ogm.c
net/batman-adv/hard-interface.c
net/batman-adv/originator.c