diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-17 22:54:25 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-17 22:54:25 +0400 |
commit | 0e496b8e84410c96d1ffc86f0b37b0328a4234da (patch) | |
tree | d8a2aeeaee03eb4f305ba4dc5ab9395c4ee31321 /net/sched/sch_api.c | |
parent | 214da6728acac285cac0e8e9b6c4c13838b8e1b0 (diff) | |
parent | 7d132055814ef17a6c7b69f342244c410a5e000f (diff) | |
download | linux-0e496b8e84410c96d1ffc86f0b37b0328a4234da.tar.xz |
Merge 3.10-rc6 into char-misc-next
We want the fixes in here.
Diffstat (limited to 'net/sched/sch_api.c')
-rw-r--r-- | net/sched/sch_api.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 2b935e7cfe7b..281c1bded1f6 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -291,17 +291,18 @@ struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r, struct nlattr *ta { struct qdisc_rate_table *rtab; + if (tab == NULL || r->rate == 0 || r->cell_log == 0 || + nla_len(tab) != TC_RTAB_SIZE) + return NULL; + for (rtab = qdisc_rtab_list; rtab; rtab = rtab->next) { - if (memcmp(&rtab->rate, r, sizeof(struct tc_ratespec)) == 0) { + if (!memcmp(&rtab->rate, r, sizeof(struct tc_ratespec)) && + !memcmp(&rtab->data, nla_data(tab), 1024)) { rtab->refcnt++; return rtab; } } - if (tab == NULL || r->rate == 0 || r->cell_log == 0 || - nla_len(tab) != TC_RTAB_SIZE) - return NULL; - rtab = kmalloc(sizeof(*rtab), GFP_KERNEL); if (rtab) { rtab->rate = *r; |