mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 14:42:24 +00:00
net/netlink_compat: Fix a missing check of nla_parse_nested
In tipc_nl_compat_sk_dump(), if nla_parse_nested() fails, it could return an error. To be consistent with other invocations of the function call, on error, the fix passes the return value upstream. Signed-off-by: Aditya Pakki <pakki001@umn.edu> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
40c3ff6d5e
commit
89dfd00837
@ -951,8 +951,11 @@ static int tipc_nl_compat_sk_dump(struct tipc_nl_compat_msg *msg,
|
||||
u32 node;
|
||||
struct nlattr *con[TIPC_NLA_CON_MAX + 1];
|
||||
|
||||
nla_parse_nested(con, TIPC_NLA_CON_MAX,
|
||||
sock[TIPC_NLA_SOCK_CON], NULL, NULL);
|
||||
err = nla_parse_nested(con, TIPC_NLA_CON_MAX,
|
||||
sock[TIPC_NLA_SOCK_CON], NULL, NULL);
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
node = nla_get_u32(con[TIPC_NLA_CON_NODE]);
|
||||
tipc_tlv_sprintf(msg->rep, " connected to <%u.%u.%u:%u>",
|
||||
|
Loading…
Reference in New Issue
Block a user