Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73533
b: refs/heads/master
c: 999acd9
h: refs/heads/master
i:
  73531: 94487a7
v: v3
  • Loading branch information
Johannes Berg authored and David S. Miller committed Nov 11, 2007
1 parent b216700 commit 359aa82
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 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: 2bf236d55e5ea2b92ed5235af09997c2995b316b
refs/heads/master: 999acd9c339a761a18d625b13001612ac396ee00
11 changes: 10 additions & 1 deletion trunk/net/mac80211/ieee80211_rate.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,22 @@ int ieee80211_rate_control_register(struct rate_control_ops *ops)
if (!ops->name)
return -EINVAL;

mutex_lock(&rate_ctrl_mutex);
list_for_each_entry(alg, &rate_ctrl_algs, list) {
if (!strcmp(alg->ops->name, ops->name)) {
/* don't register an algorithm twice */
WARN_ON(1);
return -EALREADY;
}
}

alg = kzalloc(sizeof(*alg), GFP_KERNEL);
if (alg == NULL) {
mutex_unlock(&rate_ctrl_mutex);
return -ENOMEM;
}
alg->ops = ops;

mutex_lock(&rate_ctrl_mutex);
list_add_tail(&alg->list, &rate_ctrl_algs);
mutex_unlock(&rate_ctrl_mutex);

Expand Down

0 comments on commit 359aa82

Please sign in to comment.