diff options
author | Sven Eckelmann <sven@narfation.org> | 2016-01-05 06:06:26 -0500 |
---|---|---|
committer | Antonio Quartulli <a@unstable.cc> | 2016-02-10 10:23:57 -0500 |
commit | 140ed8e87ca8f4875c2b146cdb2cdbf0c9ac6080 (patch) | |
tree | 40d25e2ba9d092af27cb7d1c322d0f2c7a8d1a69 /net/batman-adv/hard-interface.c | |
parent | aaa5672052cb0f18a5ab0ab19e9ef71c50e018a8 (diff) |
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.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index db90022c00a4..b17e272b5cb3 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c | |||
@@ -47,13 +47,16 @@ | |||
47 | #include "sysfs.h" | 47 | #include "sysfs.h" |
48 | #include "translation-table.h" | 48 | #include "translation-table.h" |
49 | 49 | ||
50 | void batadv_hardif_free_rcu(struct rcu_head *rcu) | 50 | /** |
51 | * batadv_hardif_release - release hard interface from lists and queue for | ||
52 | * free after rcu grace period | ||
53 | * @hard_iface: the hard interface to free | ||
54 | */ | ||
55 | void batadv_hardif_release(struct batadv_hard_iface *hard_iface) | ||
51 | { | 56 | { |
52 | struct batadv_hard_iface *hard_iface; | ||
53 | |||
54 | hard_iface = container_of(rcu, struct batadv_hard_iface, rcu); | ||
55 | dev_put(hard_iface->net_dev); | 57 | dev_put(hard_iface->net_dev); |
56 | kfree(hard_iface); | 58 | |
59 | kfree_rcu(hard_iface, rcu); | ||
57 | } | 60 | } |
58 | 61 | ||
59 | struct batadv_hard_iface * | 62 | struct batadv_hard_iface * |