aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/netlink/policy.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2020-08-23 11:48:27 -0700
committerDavid S. Miller <davem@davemloft.net>2020-08-23 11:48:27 -0700
commit7611cbb900b4b9a6fe5eca12fb12645c0576a015 (patch)
tree9c8c8e1fa991e4728d25a19b86c974c8e49ee1b7 /net/netlink/policy.c
parentMerge branch 'l2tp-replace-custom-logging-code-with-tracepoints' (diff)
parentMerge tag 'powerpc-5.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux (diff)
downloadwireguard-linux-7611cbb900b4b9a6fe5eca12fb12645c0576a015.tar.xz
wireguard-linux-7611cbb900b4b9a6fe5eca12fb12645c0576a015.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Diffstat (limited to 'net/netlink/policy.c')
-rw-r--r--net/netlink/policy.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/netlink/policy.c b/net/netlink/policy.c
index 46c11c9c212a..7b1f50531cd3 100644
--- a/net/netlink/policy.c
+++ b/net/netlink/policy.c
@@ -51,6 +51,9 @@ static int add_policy(struct nl_policy_dump **statep,
if (!state)
return -ENOMEM;
+ memset(&state->policies[state->n_alloc], 0,
+ flex_array_size(state, policies, n_alloc - state->n_alloc));
+
state->policies[state->n_alloc].policy = policy;
state->policies[state->n_alloc].maxtype = maxtype;
state->n_alloc = n_alloc;