aboutsummaryrefslogtreecommitdiff
path: root/net/netlink
diff options
context:
space:
mode:
authorDavid S. Miller2020-08-23 11:48:27 -0700
committerDavid S. Miller2020-08-23 11:48:27 -0700
commit7611cbb900b4b9a6fe5eca12fb12645c0576a015 (patch)
tree9c8c8e1fa991e4728d25a19b86c974c8e49ee1b7 /net/netlink
parentd7223aa5867134b9923b42e1245801bd790a1d8c (diff)
parentcb95712138ec5e480db5160b41172bbc6f6494cc (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Diffstat (limited to 'net/netlink')
-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;