aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/act_mirred.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/act_mirred.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/act_mirred.c')
-rw-r--r--net/sched/act_mirred.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index e051398fdf6b..d583aea3b3df 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -227,11 +227,13 @@ static int tcf_mirred_dump(struct sk_buff *skb, struct tc_action *a, int bind, i
227 }; 227 };
228 struct tcf_t t; 228 struct tcf_t t;
229 229
230 NLA_PUT(skb, TCA_MIRRED_PARMS, sizeof(opt), &opt); 230 if (nla_put(skb, TCA_MIRRED_PARMS, sizeof(opt), &opt))
231 goto nla_put_failure;
231 t.install = jiffies_to_clock_t(jiffies - m->tcf_tm.install); 232 t.install = jiffies_to_clock_t(jiffies - m->tcf_tm.install);
232 t.lastuse = jiffies_to_clock_t(jiffies - m->tcf_tm.lastuse); 233 t.lastuse = jiffies_to_clock_t(jiffies - m->tcf_tm.lastuse);
233 t.expires = jiffies_to_clock_t(m->tcf_tm.expires); 234 t.expires = jiffies_to_clock_t(m->tcf_tm.expires);
234 NLA_PUT(skb, TCA_MIRRED_TM, sizeof(t), &t); 235 if (nla_put(skb, TCA_MIRRED_TM, sizeof(t), &t))
236 goto nla_put_failure;
235 return skb->len; 237 return skb->len;
236 238
237nla_put_failure: 239nla_put_failure: