diff options
author | Aditya Pakki <pakki001@umn.edu> | 2018-12-23 18:54:53 -0600 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-12-24 14:42:11 -0800 |
commit | 89dfd0083751d00d5d7ead36f6d8b045bf89c5e1 (patch) | |
tree | c651f5db44d955e72cc16e80bbf39065c4c5e19c /net/tipc | |
parent | 40c3ff6d5e0809505a067dd423c110c5658c478c (diff) | |
download | lwn-89dfd0083751d00d5d7ead36f6d8b045bf89c5e1.tar.gz lwn-89dfd0083751d00d5d7ead36f6d8b045bf89c5e1.zip |
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>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/netlink_compat.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c index 6376467e78f8..21f6ccc89401 100644 --- a/net/tipc/netlink_compat.c +++ b/net/tipc/netlink_compat.c @@ -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>", |