summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/hard-interface.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2016-01-05 12:06:26 +0100
committerAntonio Quartulli <a@unstable.cc>2016-02-10 23:23:57 +0800
commit140ed8e87ca8f4875c2b146cdb2cdbf0c9ac6080 (patch)
tree40d25e2ba9d092af27cb7d1c322d0f2c7a8d1a69 /net/batman-adv/hard-interface.c
parentaaa5672052cb0f18a5ab0ab19e9ef71c50e018a8 (diff)
downloadop-kernel-dev-140ed8e87ca8f4875c2b146cdb2cdbf0c9ac6080.zip
op-kernel-dev-140ed8e87ca8f4875c2b146cdb2cdbf0c9ac6080.tar.gz
batman-adv: Drop reference to netdevice on last reference
The references to the network device should be dropped inside the release function for batadv_hard_iface similar to what is done with the batman-adv internal datastructures. 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/hard-interface.c')
-rw-r--r--net/batman-adv/hard-interface.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index db90022..b17e272 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -47,13 +47,16 @@
#include "sysfs.h"
#include "translation-table.h"
-void batadv_hardif_free_rcu(struct rcu_head *rcu)
+/**
+ * batadv_hardif_release - release hard interface from lists and queue for
+ * free after rcu grace period
+ * @hard_iface: the hard interface to free
+ */
+void batadv_hardif_release(struct batadv_hard_iface *hard_iface)
{
- struct batadv_hard_iface *hard_iface;
-
- hard_iface = container_of(rcu, struct batadv_hard_iface, rcu);
dev_put(hard_iface->net_dev);
- kfree(hard_iface);
+
+ kfree_rcu(hard_iface, rcu);
}
struct batadv_hard_iface *
OpenPOWER on IntegriCloud