Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/* protect update critical side of if_list - but not the content */
static DEFINE_SPINLOCK(if_list_lock);
/* protect update critical side of if_list - but not the content */
static DEFINE_SPINLOCK(if_list_lock);
+static void hardif_free_rcu(struct rcu_head *rcu)
+{
+ struct batman_if *batman_if;
+
+ batman_if = container_of(rcu, struct batman_if, rcu);
+ dev_put(batman_if->net_dev);
+ kref_put(&batman_if->refcount, hardif_free_ref);
+}
+
struct batman_if *get_batman_if_by_netdev(struct net_device *net_dev)
{
struct batman_if *batman_if;
struct batman_if *get_batman_if_by_netdev(struct net_device *net_dev)
{
struct batman_if *batman_if;
return;
batman_if->if_status = IF_TO_BE_REMOVED;
return;
batman_if->if_status = IF_TO_BE_REMOVED;
sysfs_del_hardif(&batman_if->hardif_obj);
sysfs_del_hardif(&batman_if->hardif_obj);
- kref_put(&batman_if->refcount, hardif_free_ref);
+ call_rcu(&batman_if->rcu, hardif_free_rcu);
}
void hardif_remove_interfaces(void)
}
void hardif_remove_interfaces(void)
struct batman_if *batman_if;
batman_if = container_of(refcount, struct batman_if, refcount);
struct batman_if *batman_if;
batman_if = container_of(refcount, struct batman_if, refcount);
- dev_put(batman_if->net_dev);
struct kref refcount;
struct packet_type batman_adv_ptype;
struct net_device *soft_iface;
struct kref refcount;
struct packet_type batman_adv_ptype;
struct net_device *soft_iface;