summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/bat_iv_ogm.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2016-01-16 10:29:54 +0100
committerAntonio Quartulli <a@unstable.cc>2016-02-10 23:24:05 +0800
commit7a659d5694b9b580615f0a813b1e6675f26c629e (patch)
tree8485c3a46f4c8c386b9871a3f567b98d87f1f386 /net/batman-adv/bat_iv_ogm.c
parent77ae32e8989a26d24bd8007be3b9dc4a348175a9 (diff)
downloadlinux-7a659d5694b9b580615f0a813b1e6675f26c629e.tar.bz2
batman-adv: Convert batadv_hard_iface to kref
batman-adv uses a self-written reference implementation which is just based on atomic_t. This is less obvious when reading the code than kref and therefore increases the change that the reference counting will be missed. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <a@unstable.cc>
Diffstat (limited to 'net/batman-adv/bat_iv_ogm.c')
-rw-r--r--net/batman-adv/bat_iv_ogm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index affcbb571426..bf0e7d6f12bb 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -644,10 +644,10 @@ static void batadv_iv_ogm_aggregate_new(const unsigned char *packet_buff,
unsigned char *skb_buff;
unsigned int skb_size;
- if (!atomic_inc_not_zero(&if_incoming->refcount))
+ if (!kref_get_unless_zero(&if_incoming->refcount))
return;
- if (!atomic_inc_not_zero(&if_outgoing->refcount))
+ if (!kref_get_unless_zero(&if_outgoing->refcount))
goto out_free_incoming;
/* own packet should always be scheduled */