]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - net/netlink/policy.c
treewide: Use fallthrough pseudo-keyword
[mirror_ubuntu-jammy-kernel.git] / net / netlink / policy.c
index f6491853c797155cb564f3d075eb372d333c4bd9..641ffbdd977abf208c6a834aceb7636335633682 100644 (file)
@@ -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;
@@ -185,7 +188,7 @@ send_attribute:
                goto next;
        case NLA_NESTED:
                type = NL_ATTR_TYPE_NESTED;
-               /* fall through */
+               fallthrough;
        case NLA_NESTED_ARRAY:
                if (pt->type == NLA_NESTED_ARRAY)
                        type = NL_ATTR_TYPE_NESTED_ARRAY;