diff options
Diffstat (limited to 'net/netlink')
-rw-r--r-- | net/netlink/genetlink.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index 9f40441d7a7d..8340ace837f2 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c | |||
@@ -635,11 +635,12 @@ static int ctrl_fill_info(struct genl_family *family, u32 pid, u32 seq, | |||
635 | if (hdr == NULL) | 635 | if (hdr == NULL) |
636 | return -1; | 636 | return -1; |
637 | 637 | ||
638 | NLA_PUT_STRING(skb, CTRL_ATTR_FAMILY_NAME, family->name); | 638 | if (nla_put_string(skb, CTRL_ATTR_FAMILY_NAME, family->name) || |
639 | NLA_PUT_U16(skb, CTRL_ATTR_FAMILY_ID, family->id); | 639 | nla_put_u16(skb, CTRL_ATTR_FAMILY_ID, family->id) || |
640 | NLA_PUT_U32(skb, CTRL_ATTR_VERSION, family->version); | 640 | nla_put_u32(skb, CTRL_ATTR_VERSION, family->version) || |
641 | NLA_PUT_U32(skb, CTRL_ATTR_HDRSIZE, family->hdrsize); | 641 | nla_put_u32(skb, CTRL_ATTR_HDRSIZE, family->hdrsize) || |
642 | NLA_PUT_U32(skb, CTRL_ATTR_MAXATTR, family->maxattr); | 642 | nla_put_u32(skb, CTRL_ATTR_MAXATTR, family->maxattr)) |
643 | goto nla_put_failure; | ||
643 | 644 | ||
644 | if (!list_empty(&family->ops_list)) { | 645 | if (!list_empty(&family->ops_list)) { |
645 | struct nlattr *nla_ops; | 646 | struct nlattr *nla_ops; |
@@ -657,8 +658,9 @@ static int ctrl_fill_info(struct genl_family *family, u32 pid, u32 seq, | |||
657 | if (nest == NULL) | 658 | if (nest == NULL) |
658 | goto nla_put_failure; | 659 | goto nla_put_failure; |
659 | 660 | ||
660 | NLA_PUT_U32(skb, CTRL_ATTR_OP_ID, ops->cmd); | 661 | if (nla_put_u32(skb, CTRL_ATTR_OP_ID, ops->cmd) || |
661 | NLA_PUT_U32(skb, CTRL_ATTR_OP_FLAGS, ops->flags); | 662 | nla_put_u32(skb, CTRL_ATTR_OP_FLAGS, ops->flags)) |
663 | goto nla_put_failure; | ||
662 | 664 | ||
663 | nla_nest_end(skb, nest); | 665 | nla_nest_end(skb, nest); |
664 | } | 666 | } |
@@ -682,9 +684,10 @@ static int ctrl_fill_info(struct genl_family *family, u32 pid, u32 seq, | |||
682 | if (nest == NULL) | 684 | if (nest == NULL) |
683 | goto nla_put_failure; | 685 | goto nla_put_failure; |
684 | 686 | ||
685 | NLA_PUT_U32(skb, CTRL_ATTR_MCAST_GRP_ID, grp->id); | 687 | if (nla_put_u32(skb, CTRL_ATTR_MCAST_GRP_ID, grp->id) || |
686 | NLA_PUT_STRING(skb, CTRL_ATTR_MCAST_GRP_NAME, | 688 | nla_put_string(skb, CTRL_ATTR_MCAST_GRP_NAME, |
687 | grp->name); | 689 | grp->name)) |
690 | goto nla_put_failure; | ||
688 | 691 | ||
689 | nla_nest_end(skb, nest); | 692 | nla_nest_end(skb, nest); |
690 | } | 693 | } |
@@ -710,8 +713,9 @@ static int ctrl_fill_mcgrp_info(struct genl_multicast_group *grp, u32 pid, | |||
710 | if (hdr == NULL) | 713 | if (hdr == NULL) |
711 | return -1; | 714 | return -1; |
712 | 715 | ||
713 | NLA_PUT_STRING(skb, CTRL_ATTR_FAMILY_NAME, grp->family->name); | 716 | if (nla_put_string(skb, CTRL_ATTR_FAMILY_NAME, grp->family->name) || |
714 | NLA_PUT_U16(skb, CTRL_ATTR_FAMILY_ID, grp->family->id); | 717 | nla_put_u16(skb, CTRL_ATTR_FAMILY_ID, grp->family->id)) |
718 | goto nla_put_failure; | ||
715 | 719 | ||
716 | nla_grps = nla_nest_start(skb, CTRL_ATTR_MCAST_GROUPS); | 720 | nla_grps = nla_nest_start(skb, CTRL_ATTR_MCAST_GROUPS); |
717 | if (nla_grps == NULL) | 721 | if (nla_grps == NULL) |
@@ -721,9 +725,10 @@ static int ctrl_fill_mcgrp_info(struct genl_multicast_group *grp, u32 pid, | |||
721 | if (nest == NULL) | 725 | if (nest == NULL) |
722 | goto nla_put_failure; | 726 | goto nla_put_failure; |
723 | 727 | ||
724 | NLA_PUT_U32(skb, CTRL_ATTR_MCAST_GRP_ID, grp->id); | 728 | if (nla_put_u32(skb, CTRL_ATTR_MCAST_GRP_ID, grp->id) || |
725 | NLA_PUT_STRING(skb, CTRL_ATTR_MCAST_GRP_NAME, | 729 | nla_put_string(skb, CTRL_ATTR_MCAST_GRP_NAME, |
726 | grp->name); | 730 | grp->name)) |
731 | goto nla_put_failure; | ||
727 | 732 | ||
728 | nla_nest_end(skb, nest); | 733 | nla_nest_end(skb, nest); |
729 | nla_nest_end(skb, nla_grps); | 734 | nla_nest_end(skb, nla_grps); |