Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 222858
b: refs/heads/master
c: 9ee8987
h: refs/heads/master
v: v3
  • Loading branch information
Sven Eckelmann authored and Greg Kroah-Hartman committed Nov 29, 2010
1 parent 140063d commit fef2176
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6df78338e7af7960b67fa00aa2a5c63986a23d3c
refs/heads/master: 9ee898739b7e4d292abed911008b3f91b442118a
19 changes: 13 additions & 6 deletions trunk/drivers/staging/batman-adv/hard-interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,6 @@ static void hardif_remove_interface(struct batman_if *batman_if)
return;

batman_if->if_status = IF_TO_BE_REMOVED;

/* caller must take if_list_lock */
list_del_rcu(&batman_if->list);
synchronize_rcu();
sysfs_del_hardif(&batman_if->hardif_obj);
hardif_put(batman_if);
Expand All @@ -474,13 +471,21 @@ static void hardif_remove_interface(struct batman_if *batman_if)
void hardif_remove_interfaces(void)
{
struct batman_if *batman_if, *batman_if_tmp;
struct list_head if_queue;

INIT_LIST_HEAD(&if_queue);

rtnl_lock();
spin_lock(&if_list_lock);
list_for_each_entry_safe(batman_if, batman_if_tmp, &if_list, list) {
hardif_remove_interface(batman_if);
list_del_rcu(&batman_if->list);
list_add_tail(&batman_if->list, &if_queue);
}
spin_unlock(&if_list_lock);

rtnl_lock();
list_for_each_entry_safe(batman_if, batman_if_tmp, &if_queue, list) {
hardif_remove_interface(batman_if);
}
rtnl_unlock();
}

Expand All @@ -507,8 +512,10 @@ static int hard_if_event(struct notifier_block *this,
break;
case NETDEV_UNREGISTER:
spin_lock(&if_list_lock);
hardif_remove_interface(batman_if);
list_del_rcu(&batman_if->list);
spin_unlock(&if_list_lock);

hardif_remove_interface(batman_if);
break;
case NETDEV_CHANGEMTU:
if (batman_if->soft_iface)
Expand Down

0 comments on commit fef2176

Please sign in to comment.