aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_fw.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/cls_fw.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/cls_fw.c')
-rw-r--r--net/sched/cls_fw.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c
index 389af152ec45..8384a4797240 100644
--- a/net/sched/cls_fw.c
+++ b/net/sched/cls_fw.c
@@ -346,14 +346,17 @@ static int fw_dump(struct tcf_proto *tp, unsigned long fh,
346 if (nest == NULL) 346 if (nest == NULL)
347 goto nla_put_failure; 347 goto nla_put_failure;
348 348
349 if (f->res.classid) 349 if (f->res.classid &&
350 NLA_PUT_U32(skb, TCA_FW_CLASSID, f->res.classid); 350 nla_put_u32(skb, TCA_FW_CLASSID, f->res.classid))
351 goto nla_put_failure;
351#ifdef CONFIG_NET_CLS_IND 352#ifdef CONFIG_NET_CLS_IND
352 if (strlen(f->indev)) 353 if (strlen(f->indev) &&
353 NLA_PUT_STRING(skb, TCA_FW_INDEV, f->indev); 354 nla_put_string(skb, TCA_FW_INDEV, f->indev))
355 goto nla_put_failure;
354#endif /* CONFIG_NET_CLS_IND */ 356#endif /* CONFIG_NET_CLS_IND */
355 if (head->mask != 0xFFFFFFFF) 357 if (head->mask != 0xFFFFFFFF &&
356 NLA_PUT_U32(skb, TCA_FW_MASK, head->mask); 358 nla_put_u32(skb, TCA_FW_MASK, head->mask))
359 goto nla_put_failure;
357 360
358 if (tcf_exts_dump(skb, &f->exts, &fw_ext_map) < 0) 361 if (tcf_exts_dump(skb, &f->exts, &fw_ext_map) < 0)
359 goto nla_put_failure; 362 goto nla_put_failure;