Merge branch 'for-arm' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal...
[firefly-linux-kernel-4.4.55.git] / net / sched / sch_qfq.c
index e68cb440756a4c33ce1108d464ea51b1c0b95631..9af01f3df18c66b6325c8afe628758b56e306952 100644 (file)
@@ -429,8 +429,9 @@ static int qfq_dump_class(struct Qdisc *sch, unsigned long arg,
        nest = nla_nest_start(skb, TCA_OPTIONS);
        if (nest == NULL)
                goto nla_put_failure;
-       NLA_PUT_U32(skb, TCA_QFQ_WEIGHT, ONE_FP/cl->inv_w);
-       NLA_PUT_U32(skb, TCA_QFQ_LMAX, cl->lmax);
+       if (nla_put_u32(skb, TCA_QFQ_WEIGHT, ONE_FP/cl->inv_w) ||
+           nla_put_u32(skb, TCA_QFQ_LMAX, cl->lmax))
+               goto nla_put_failure;
        return nla_nest_end(skb, nest);
 
 nla_put_failure: