summaryrefslogtreecommitdiff
path: root/net/tipc
diff options
context:
space:
mode:
authorAditya Pakki <pakki001@umn.edu>2018-12-24 03:54:53 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-05 11:20:50 +0300
commitef354c629ce73d0ca8e445efc947eefe4a26f622 (patch)
treed3cc042128ebfa93c4fb593ecf447dcfdb5167ed /net/tipc
parent7281cde1d36bd4a89950bd8dee2b3723d99dbfab (diff)
downloadlinux-ef354c629ce73d0ca8e445efc947eefe4a26f622.tar.xz
net/netlink_compat: Fix a missing check of nla_parse_nested
[ Upstream commit 89dfd0083751d00d5d7ead36f6d8b045bf89c5e1 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/netlink_compat.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c
index 318c541970ec..6494d6b5e1b2 100644
--- a/net/tipc/netlink_compat.c
+++ b/net/tipc/netlink_compat.c
@@ -1030,8 +1030,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>",