aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_hfsc.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-03-29 05:11:39 -0400
committerDavid S. Miller <davem@davemloft.net>2012-04-01 18:11:37 -0400
commit1b34ec43c9b3de44a5420841ab293d1b2035a94c (patch)
tree8d6cf966c813e0e61001655179b5ef8e5f1b54b3 /net/sched/sch_hfsc.c
parent9360ffd1859720f6520cf59241909b74dae369d0 (diff)
pkt_sched: Stop using NLA_PUT*().
These macros contain a hidden goto, and are thus extremely error prone and make code hard to audit. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_hfsc.c')
-rw-r--r--net/sched/sch_hfsc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index 9bdca2e011e9..8db3e2c72827 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -1305,7 +1305,8 @@ hfsc_dump_sc(struct sk_buff *skb, int attr, struct internal_sc *sc)
1305 tsc.m1 = sm2m(sc->sm1); 1305 tsc.m1 = sm2m(sc->sm1);
1306 tsc.d = dx2d(sc->dx); 1306 tsc.d = dx2d(sc->dx);
1307 tsc.m2 = sm2m(sc->sm2); 1307 tsc.m2 = sm2m(sc->sm2);
1308 NLA_PUT(skb, attr, sizeof(tsc), &tsc); 1308 if (nla_put(skb, attr, sizeof(tsc), &tsc))
1309 goto nla_put_failure;
1309 1310
1310 return skb->len; 1311 return skb->len;
1311 1312
@@ -1573,7 +1574,8 @@ hfsc_dump_qdisc(struct Qdisc *sch, struct sk_buff *skb)
1573 } 1574 }
1574 1575
1575 qopt.defcls = q->defcls; 1576 qopt.defcls = q->defcls;
1576 NLA_PUT(skb, TCA_OPTIONS, sizeof(qopt), &qopt); 1577 if (nla_put(skb, TCA_OPTIONS, sizeof(qopt), &qopt))
1578 goto nla_put_failure;
1577 return skb->len; 1579 return skb->len;
1578 1580
1579 nla_put_failure: 1581 nla_put_failure: