Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 228170
b: refs/heads/master
c: 3f42760
h: refs/heads/master
v: v3
  • Loading branch information
Marek Lindner authored and Greg Kroah-Hartman committed Nov 29, 2010
1 parent 5b22f41 commit 72bf71c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 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: b4abfcd4c79ec12340b4c68e3a211badd3c90e20
refs/heads/master: 3f427604d669031343af8e6ecd8d1cc7a6408ab2
12 changes: 10 additions & 2 deletions trunk/drivers/staging/batman-adv/hard-interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@
/* 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;
Expand Down Expand Up @@ -462,9 +471,8 @@ static void hardif_remove_interface(struct batman_if *batman_if)
return;

batman_if->if_status = IF_TO_BE_REMOVED;
synchronize_rcu();
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)
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/staging/batman-adv/hard-interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ static inline void hardif_free_ref(struct kref *refcount)
struct batman_if *batman_if;

batman_if = container_of(refcount, struct batman_if, refcount);
dev_put(batman_if->net_dev);
kfree(batman_if);
}

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/staging/batman-adv/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ struct batman_if {
struct kref refcount;
struct packet_type batman_adv_ptype;
struct net_device *soft_iface;
struct rcu_head rcu;
};

/**
Expand Down

0 comments on commit 72bf71c

Please sign in to comment.