net: tipc: allocate attrs locally instead of using genl_family_attrbuf in compat_dumpit()

As this is the last user of genl_family_attrbuf, convert to allocate
attrs locally and do it in a similar way this is done in compat_doit().

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jiri Pirko
2019-10-05 20:04:40 +02:00
committed by David S. Miller
parent 057af70713
commit c6c08614eb
3 changed files with 15 additions and 17 deletions

View File

@@ -271,18 +271,6 @@ struct genl_family tipc_genl_family __ro_after_init = {
.n_ops = ARRAY_SIZE(tipc_genl_v2_ops),
};
int tipc_nlmsg_parse(const struct nlmsghdr *nlh, struct nlattr ***attr)
{
u32 maxattr = tipc_genl_family.maxattr;
*attr = genl_family_attrbuf(&tipc_genl_family);
if (!*attr)
return -EOPNOTSUPP;
return nlmsg_parse_deprecated(nlh, GENL_HDRLEN, *attr, maxattr,
tipc_nl_policy, NULL);
}
int __init tipc_netlink_start(void)
{
int res;