Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 209920
b: refs/heads/master
c: 9abc102
h: refs/heads/master
v: v3
  • Loading branch information
Marek Lindner authored and Greg Kroah-Hartman committed Aug 24, 2010
1 parent 9cf3cd8 commit 4aa30f5
Show file tree
Hide file tree
Showing 2 changed files with 9 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: 466122df80e447883588ffcf9d21b88152934819
refs/heads/master: 9abc10238e1df7ce81c58a441f65efd5e905b9e8
14 changes: 8 additions & 6 deletions trunk/drivers/staging/batman-adv/originator.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,12 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
int orig_hash_add_if(struct batman_if *batman_if, int max_if_num)
{
struct orig_node *orig_node;
unsigned long flags;
HASHIT(hashit);

/* resize all orig nodes because orig_node->bcast_own(_sum) depend on
* if_num */
spin_lock(&orig_hash_lock);
spin_lock_irqsave(&orig_hash_lock, flags);

while (hash_iterate(orig_hash, &hashit)) {
orig_node = hashit.bucket->data;
Expand All @@ -404,11 +405,11 @@ int orig_hash_add_if(struct batman_if *batman_if, int max_if_num)
goto err;
}

spin_unlock(&orig_hash_lock);
spin_unlock_irqrestore(&orig_hash_lock, flags);
return 0;

err:
spin_unlock(&orig_hash_lock);
spin_unlock_irqrestore(&orig_hash_lock, flags);
return -ENOMEM;
}

Expand Down Expand Up @@ -468,12 +469,13 @@ int orig_hash_del_if(struct batman_if *batman_if, int max_if_num)
{
struct batman_if *batman_if_tmp;
struct orig_node *orig_node;
unsigned long flags;
HASHIT(hashit);
int ret;

/* resize all orig nodes because orig_node->bcast_own(_sum) depend on
* if_num */
spin_lock(&orig_hash_lock);
spin_lock_irqsave(&orig_hash_lock, flags);

while (hash_iterate(orig_hash, &hashit)) {
orig_node = hashit.bucket->data;
Expand All @@ -500,10 +502,10 @@ int orig_hash_del_if(struct batman_if *batman_if, int max_if_num)
rcu_read_unlock();

batman_if->if_num = -1;
spin_unlock(&orig_hash_lock);
spin_unlock_irqrestore(&orig_hash_lock, flags);
return 0;

err:
spin_unlock(&orig_hash_lock);
spin_unlock_irqrestore(&orig_hash_lock, flags);
return -ENOMEM;
}

0 comments on commit 4aa30f5

Please sign in to comment.