Merge branch 'for-arm' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal...
[firefly-linux-kernel-4.4.55.git] / net / ipv6 / ip6mr.c
index 8110362e0af558a9ff77824bc78c1b3677369855..b15dc08643a42f5a45ea9bb0bd2bd0ec1865a377 100644 (file)
@@ -1147,8 +1147,7 @@ static int ip6mr_cache_report(struct mr6_table *mrt, struct sk_buff *pkt,
         */
        ret = sock_queue_rcv_skb(mrt->mroute6_sk, skb);
        if (ret < 0) {
-               if (net_ratelimit())
-                       printk(KERN_WARNING "mroute6: pending queue full, dropping entries.\n");
+               net_warn_ratelimited("mroute6: pending queue full, dropping entries\n");
                kfree_skb(skb);
        }
 
@@ -1351,7 +1350,7 @@ int __init ip6_mr_init(void)
                goto reg_notif_fail;
 #ifdef CONFIG_IPV6_PIMSM_V2
        if (inet6_add_protocol(&pim6_protocol, IPPROTO_PIM) < 0) {
-               printk(KERN_ERR "ip6_mr_init: can't add PIM protocol\n");
+               pr_err("%s: can't add PIM protocol\n", __func__);
                err = -EAGAIN;
                goto add_proto_fail;
        }
@@ -2215,14 +2214,15 @@ static int ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb,
        rtm->rtm_src_len  = 128;
        rtm->rtm_tos      = 0;
        rtm->rtm_table    = mrt->id;
-       NLA_PUT_U32(skb, RTA_TABLE, mrt->id);
+       if (nla_put_u32(skb, RTA_TABLE, mrt->id))
+               goto nla_put_failure;
        rtm->rtm_scope    = RT_SCOPE_UNIVERSE;
        rtm->rtm_protocol = RTPROT_UNSPEC;
        rtm->rtm_flags    = 0;
 
-       NLA_PUT(skb, RTA_SRC, 16, &c->mf6c_origin);
-       NLA_PUT(skb, RTA_DST, 16, &c->mf6c_mcastgrp);
-
+       if (nla_put(skb, RTA_SRC, 16, &c->mf6c_origin) ||
+           nla_put(skb, RTA_DST, 16, &c->mf6c_mcastgrp))
+               goto nla_put_failure;
        if (__ip6mr_fill_mroute(mrt, skb, c, rtm) < 0)
                goto nla_put_failure;