diff options
| author | Chris Metcalf <cmetcalf@tilera.com> | 2010-08-06 10:37:02 -0400 |
|---|---|---|
| committer | Chris Metcalf <cmetcalf@tilera.com> | 2010-08-06 10:37:02 -0400 |
| commit | ab11b487402f97975f3ac1eeea09c82f4431481e (patch) | |
| tree | 86337c5cbbd2b0c4bd07c0847a1dc7de3d898147 /net/sched/act_api.c | |
| parent | 1c689cbcf2c2b7a35cd237abddd9206bb1b6fee1 (diff) | |
| parent | fc1caf6eafb30ea185720e29f7f5eccca61ecd60 (diff) | |
Merge branch 'master' into for-linus
Diffstat (limited to 'net/sched/act_api.c')
| -rw-r--r-- | net/sched/act_api.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 972378f47f3c..23b25f89e7e0 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c | |||
| @@ -26,6 +26,11 @@ | |||
| 26 | #include <net/act_api.h> | 26 | #include <net/act_api.h> |
| 27 | #include <net/netlink.h> | 27 | #include <net/netlink.h> |
| 28 | 28 | ||
| 29 | static void tcf_common_free_rcu(struct rcu_head *head) | ||
| 30 | { | ||
| 31 | kfree(container_of(head, struct tcf_common, tcfc_rcu)); | ||
| 32 | } | ||
| 33 | |||
| 29 | void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo) | 34 | void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo) |
| 30 | { | 35 | { |
| 31 | unsigned int h = tcf_hash(p->tcfc_index, hinfo->hmask); | 36 | unsigned int h = tcf_hash(p->tcfc_index, hinfo->hmask); |
| @@ -38,7 +43,11 @@ void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo) | |||
| 38 | write_unlock_bh(hinfo->lock); | 43 | write_unlock_bh(hinfo->lock); |
| 39 | gen_kill_estimator(&p->tcfc_bstats, | 44 | gen_kill_estimator(&p->tcfc_bstats, |
| 40 | &p->tcfc_rate_est); | 45 | &p->tcfc_rate_est); |
| 41 | kfree(p); | 46 | /* |
| 47 | * gen_estimator est_timer() might access p->tcfc_lock | ||
| 48 | * or bstats, wait a RCU grace period before freeing p | ||
| 49 | */ | ||
| 50 | call_rcu(&p->tcfc_rcu, tcf_common_free_rcu); | ||
| 42 | return; | 51 | return; |
| 43 | } | 52 | } |
| 44 | } | 53 | } |
