aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_cbq.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/sch_cbq.c')
-rw-r--r--net/sched/sch_cbq.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index 24d94c097b35..6aabd77d1cfd 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -1425,7 +1425,8 @@ static int cbq_dump_rate(struct sk_buff *skb, struct cbq_class *cl)
1425{ 1425{
1426 unsigned char *b = skb_tail_pointer(skb); 1426 unsigned char *b = skb_tail_pointer(skb);
1427 1427
1428 NLA_PUT(skb, TCA_CBQ_RATE, sizeof(cl->R_tab->rate), &cl->R_tab->rate); 1428 if (nla_put(skb, TCA_CBQ_RATE, sizeof(cl->R_tab->rate), &cl->R_tab->rate))
1429 goto nla_put_failure;
1429 return skb->len; 1430 return skb->len;
1430 1431
1431nla_put_failure: 1432nla_put_failure:
@@ -1450,7 +1451,8 @@ static int cbq_dump_lss(struct sk_buff *skb, struct cbq_class *cl)
1450 opt.minidle = (u32)(-cl->minidle); 1451 opt.minidle = (u32)(-cl->minidle);
1451 opt.offtime = cl->offtime; 1452 opt.offtime = cl->offtime;
1452 opt.change = ~0; 1453 opt.change = ~0;
1453 NLA_PUT(skb, TCA_CBQ_LSSOPT, sizeof(opt), &opt); 1454 if (nla_put(skb, TCA_CBQ_LSSOPT, sizeof(opt), &opt))
1455 goto nla_put_failure;
1454 return skb->len; 1456 return skb->len;
1455 1457
1456nla_put_failure: 1458nla_put_failure:
@@ -1468,7 +1470,8 @@ static int cbq_dump_wrr(struct sk_buff *skb, struct cbq_class *cl)
1468 opt.priority = cl->priority + 1; 1470 opt.priority = cl->priority + 1;
1469 opt.cpriority = cl->cpriority + 1; 1471 opt.cpriority = cl->cpriority + 1;
1470 opt.weight = cl->weight; 1472 opt.weight = cl->weight;
1471 NLA_PUT(skb, TCA_CBQ_WRROPT, sizeof(opt), &opt); 1473 if (nla_put(skb, TCA_CBQ_WRROPT, sizeof(opt), &opt))
1474 goto nla_put_failure;
1472 return skb->len; 1475 return skb->len;
1473 1476
1474nla_put_failure: 1477nla_put_failure:
@@ -1485,7 +1488,8 @@ static int cbq_dump_ovl(struct sk_buff *skb, struct cbq_class *cl)
1485 opt.priority2 = cl->priority2 + 1; 1488 opt.priority2 = cl->priority2 + 1;
1486 opt.pad = 0; 1489 opt.pad = 0;
1487 opt.penalty = cl->penalty; 1490 opt.penalty = cl->penalty;
1488 NLA_PUT(skb, TCA_CBQ_OVL_STRATEGY, sizeof(opt), &opt); 1491 if (nla_put(skb, TCA_CBQ_OVL_STRATEGY, sizeof(opt), &opt))
1492 goto nla_put_failure;
1489 return skb->len; 1493 return skb->len;
1490 1494
1491nla_put_failure: 1495nla_put_failure:
@@ -1502,7 +1506,8 @@ static int cbq_dump_fopt(struct sk_buff *skb, struct cbq_class *cl)
1502 opt.split = cl->split ? cl->split->common.classid : 0; 1506 opt.split = cl->split ? cl->split->common.classid : 0;
1503 opt.defmap = cl->defmap; 1507 opt.defmap = cl->defmap;
1504 opt.defchange = ~0; 1508 opt.defchange = ~0;
1505 NLA_PUT(skb, TCA_CBQ_FOPT, sizeof(opt), &opt); 1509 if (nla_put(skb, TCA_CBQ_FOPT, sizeof(opt), &opt))
1510 goto nla_put_failure;
1506 } 1511 }
1507 return skb->len; 1512 return skb->len;
1508 1513
@@ -1521,7 +1526,8 @@ static int cbq_dump_police(struct sk_buff *skb, struct cbq_class *cl)
1521 opt.police = cl->police; 1526 opt.police = cl->police;
1522 opt.__res1 = 0; 1527 opt.__res1 = 0;
1523 opt.__res2 = 0; 1528 opt.__res2 = 0;
1524 NLA_PUT(skb, TCA_CBQ_POLICE, sizeof(opt), &opt); 1529 if (nla_put(skb, TCA_CBQ_POLICE, sizeof(opt), &opt))
1530 goto nla_put_failure;
1525 } 1531 }
1526 return skb->len; 1532 return skb->len;
1527 1533