diff options
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r-- | net/tipc/node.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c index b0b840084f0a..6a44eb812baf 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -1977,6 +1977,7 @@ out: | |||
1977 | int tipc_nl_node_get_link(struct sk_buff *skb, struct genl_info *info) | 1977 | int tipc_nl_node_get_link(struct sk_buff *skb, struct genl_info *info) |
1978 | { | 1978 | { |
1979 | struct net *net = genl_info_net(info); | 1979 | struct net *net = genl_info_net(info); |
1980 | struct nlattr *attrs[TIPC_NLA_LINK_MAX + 1]; | ||
1980 | struct tipc_nl_msg msg; | 1981 | struct tipc_nl_msg msg; |
1981 | char *name; | 1982 | char *name; |
1982 | int err; | 1983 | int err; |
@@ -1984,9 +1985,19 @@ int tipc_nl_node_get_link(struct sk_buff *skb, struct genl_info *info) | |||
1984 | msg.portid = info->snd_portid; | 1985 | msg.portid = info->snd_portid; |
1985 | msg.seq = info->snd_seq; | 1986 | msg.seq = info->snd_seq; |
1986 | 1987 | ||
1987 | if (!info->attrs[TIPC_NLA_LINK_NAME]) | 1988 | if (!info->attrs[TIPC_NLA_LINK]) |
1988 | return -EINVAL; | 1989 | return -EINVAL; |
1989 | name = nla_data(info->attrs[TIPC_NLA_LINK_NAME]); | 1990 | |
1991 | err = nla_parse_nested(attrs, TIPC_NLA_LINK_MAX, | ||
1992 | info->attrs[TIPC_NLA_LINK], | ||
1993 | tipc_nl_link_policy, info->extack); | ||
1994 | if (err) | ||
1995 | return err; | ||
1996 | |||
1997 | if (!attrs[TIPC_NLA_LINK_NAME]) | ||
1998 | return -EINVAL; | ||
1999 | |||
2000 | name = nla_data(attrs[TIPC_NLA_LINK_NAME]); | ||
1990 | 2001 | ||
1991 | msg.skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); | 2002 | msg.skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); |
1992 | if (!msg.skb) | 2003 | if (!msg.skb) |