]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/commitdiff
cls_can: Stop using NLA_PUT*()
authorRostislav Lisovy <lisovy@gmail.com>
Mon, 4 Jun 2012 12:13:05 +0000 (14:13 +0200)
committerRostislav Lisovy <lisovy@gmail.com>
Mon, 4 Jun 2012 12:13:05 +0000 (14:13 +0200)
net/sched/cls_can.c

index 111668e41e821b687b7ced4ef63eb7df0381977e..dcb27920be92768ecee759a4069953626c92bbe9 100644 (file)
@@ -519,12 +519,13 @@ static int canfltr_dump(struct tcf_proto *tp, unsigned long fh,
        if (nest == NULL)
                goto nla_put_failure;
 
-       if (f->res.classid)
-               NLA_PUT_U32(skb, TCA_CANFLTR_CLASSID, f->res.classid);
-
-       NLA_PUT(skb, TCA_CANFLTR_RULES, r->rules_count *
-               sizeof(struct can_filter), r->rules_raw);
+       if (f->res.classid &&
+           nla_put_u32(skb, TCA_CANFLTR_CLASSID, f->res.classid))
+               goto nla_put_failure;
 
+       if (nla_put(skb, TCA_CANFLTR_RULES, r->rules_count *
+           sizeof(struct can_filter), r->rules_raw)
+               goto nla_put_failure;
 
        nla_nest_end(skb, nest);