diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c index 217516357ef2..be905aa3c204 100644 --- a/net/tipc/netlink_compat.c +++ b/net/tipc/netlink_compat.c @@ -272,11 +272,14 @@ static int __tipc_nl_compat_dumpit(struct tipc_nl_compat_cmd_dump *cmd, return err; } +static struct genl_family tipc_genl_compat_family; + static int tipc_nl_compat_dumpit(struct tipc_nl_compat_cmd_dump *cmd, struct tipc_nl_compat_msg *msg) { - int err; struct sk_buff *arg; + void *hdr; + int err; if (msg->req_type && (!msg->req_size || !TLV_CHECK_TYPE(msg->req, msg->req_type))) @@ -305,6 +308,16 @@ static int tipc_nl_compat_dumpit(struct tipc_nl_compat_cmd_dump *cmd, return -ENOMEM; } + hdr = genlmsg_put(arg, 0, 0, &tipc_genl_compat_family, NLM_F_MULTI, + TIPC_GENL_CMD); + if (!hdr) { + kfree_skb(msg->rep); + msg->rep = NULL; + kfree_skb(arg); + return -EMSGSIZE; + } + genlmsg_end(arg, hdr); + err = __tipc_nl_compat_dumpit(cmd, msg, arg); if (err) { kfree_skb(msg->rep);