aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/sch_api.c')
-rw-r--r--net/sched/sch_api.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 9372ec41ce84..ef0efeca6352 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -332,7 +332,7 @@ static struct qdisc_size_table *qdisc_get_stab(struct nlattr *opt)
332 if (!s || tsize != s->tsize || (!tab && tsize > 0)) 332 if (!s || tsize != s->tsize || (!tab && tsize > 0))
333 return ERR_PTR(-EINVAL); 333 return ERR_PTR(-EINVAL);
334 334
335 spin_lock_bh(&qdisc_stab_lock); 335 spin_lock(&qdisc_stab_lock);
336 336
337 list_for_each_entry(stab, &qdisc_stab_list, list) { 337 list_for_each_entry(stab, &qdisc_stab_list, list) {
338 if (memcmp(&stab->szopts, s, sizeof(*s))) 338 if (memcmp(&stab->szopts, s, sizeof(*s)))
@@ -340,11 +340,11 @@ static struct qdisc_size_table *qdisc_get_stab(struct nlattr *opt)
340 if (tsize > 0 && memcmp(stab->data, tab, tsize * sizeof(u16))) 340 if (tsize > 0 && memcmp(stab->data, tab, tsize * sizeof(u16)))
341 continue; 341 continue;
342 stab->refcnt++; 342 stab->refcnt++;
343 spin_unlock_bh(&qdisc_stab_lock); 343 spin_unlock(&qdisc_stab_lock);
344 return stab; 344 return stab;
345 } 345 }
346 346
347 spin_unlock_bh(&qdisc_stab_lock); 347 spin_unlock(&qdisc_stab_lock);
348 348
349 stab = kmalloc(sizeof(*stab) + tsize * sizeof(u16), GFP_KERNEL); 349 stab = kmalloc(sizeof(*stab) + tsize * sizeof(u16), GFP_KERNEL);
350 if (!stab) 350 if (!stab)
@@ -355,9 +355,9 @@ static struct qdisc_size_table *qdisc_get_stab(struct nlattr *opt)
355 if (tsize > 0) 355 if (tsize > 0)
356 memcpy(stab->data, tab, tsize * sizeof(u16)); 356 memcpy(stab->data, tab, tsize * sizeof(u16));
357 357
358 spin_lock_bh(&qdisc_stab_lock); 358 spin_lock(&qdisc_stab_lock);
359 list_add_tail(&stab->list, &qdisc_stab_list); 359 list_add_tail(&stab->list, &qdisc_stab_list);
360 spin_unlock_bh(&qdisc_stab_lock); 360 spin_unlock(&qdisc_stab_lock);
361 361
362 return stab; 362 return stab;
363} 363}
@@ -367,14 +367,14 @@ void qdisc_put_stab(struct qdisc_size_table *tab)
367 if (!tab) 367 if (!tab)
368 return; 368 return;
369 369
370 spin_lock_bh(&qdisc_stab_lock); 370 spin_lock(&qdisc_stab_lock);
371 371
372 if (--tab->refcnt == 0) { 372 if (--tab->refcnt == 0) {
373 list_del(&tab->list); 373 list_del(&tab->list);
374 kfree(tab); 374 kfree(tab);
375 } 375 }
376 376
377 spin_unlock_bh(&qdisc_stab_lock); 377 spin_unlock(&qdisc_stab_lock);
378} 378}
379EXPORT_SYMBOL(qdisc_put_stab); 379EXPORT_SYMBOL(qdisc_put_stab);
380 380