diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c
index 217516357ef2..834543c104dd 100644
--- a/net/tipc/netlink_compat.c
+++ b/net/tipc/netlink_compat.c
@@ -194,6 +194,9 @@ static int __tipc_nl_compat_dumpit(struct tipc_nl_compat_cmd_dump *cmd,
 	cb.skb = arg;
 	cb.data = &info;
 
+	if (arg->len < sizeof(struct nlmsghdr))
+		return -EINVAL;
+
 	buf = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
 	if (!buf)
 		return -ENOMEM;