]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ecryptfs: simplify list initialization in ecryptfs_parse_packet_set()
authorBaolin Liu <liubaolin@kylinos.cn>
Tue, 11 Nov 2025 12:13:25 +0000 (20:13 +0800)
committerTyler Hicks <code@tyhicks.com>
Tue, 23 Dec 2025 21:23:23 +0000 (15:23 -0600)
In ecryptfs_parse_packet_set(),use LIST_HEAD() to declare and
initialize the 'auth_tok_list' list in one step instead of
using INIT_LIST_HEAD() separately.

No functional change.

Signed-off-by: Baolin Liu <liubaolin@kylinos.cn>
Signed-off-by: Tyler Hicks <code@tyhicks.com>
fs/ecryptfs/keystore.c

index 3a6283477d61d3ae4636964b81273843bc4e3585..32e5e250c2dc6b8f5d9fe8ca2e798064863c10b9 100644 (file)
@@ -1716,7 +1716,7 @@ int ecryptfs_parse_packet_set(struct ecryptfs_crypt_stat *crypt_stat,
        size_t i = 0;
        size_t found_auth_tok;
        size_t next_packet_is_auth_tok_packet;
-       struct list_head auth_tok_list;
+       LIST_HEAD(auth_tok_list);
        struct ecryptfs_auth_tok *matching_auth_tok;
        struct ecryptfs_auth_tok *candidate_auth_tok;
        char *candidate_auth_tok_sig;
@@ -1729,7 +1729,6 @@ int ecryptfs_parse_packet_set(struct ecryptfs_crypt_stat *crypt_stat,
        struct key *auth_tok_key = NULL;
        int rc = 0;
 
-       INIT_LIST_HEAD(&auth_tok_list);
        /* Parse the header to find as many packets as we can; these will be
         * added the our &auth_tok_list */
        next_packet_is_auth_tok_packet = 1;