aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ecryptfs/keystore.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
index a1764fe3318c..8eb0746313d0 100644
--- a/fs/ecryptfs/keystore.c
+++ b/fs/ecryptfs/keystore.c
@@ -469,26 +469,19 @@ out:
469 469
470static void wipe_auth_tok_list(struct list_head *auth_tok_list_head) 470static void wipe_auth_tok_list(struct list_head *auth_tok_list_head)
471{ 471{
472 struct list_head *walker;
473 struct ecryptfs_auth_tok_list_item *auth_tok_list_item; 472 struct ecryptfs_auth_tok_list_item *auth_tok_list_item;
473 struct ecryptfs_auth_tok_list_item *auth_tok_list_item_tmp;
474 474
475 walker = auth_tok_list_head->next; 475 list_for_each_entry_safe(auth_tok_list_item, auth_tok_list_item_tmp,
476 while (walker != auth_tok_list_head) { 476 auth_tok_list_head, list) {
477 auth_tok_list_item = 477 list_del(&auth_tok_list_item->list);
478 list_entry(walker, struct ecryptfs_auth_tok_list_item,
479 list);
480 walker = auth_tok_list_item->list.next;
481 memset(auth_tok_list_item, 0,
482 sizeof(struct ecryptfs_auth_tok_list_item));
483 kmem_cache_free(ecryptfs_auth_tok_list_item_cache, 478 kmem_cache_free(ecryptfs_auth_tok_list_item_cache,
484 auth_tok_list_item); 479 auth_tok_list_item);
485 } 480 }
486 auth_tok_list_head->next = NULL;
487} 481}
488 482
489struct kmem_cache *ecryptfs_auth_tok_list_item_cache; 483struct kmem_cache *ecryptfs_auth_tok_list_item_cache;
490 484
491
492/** 485/**
493 * parse_tag_1_packet 486 * parse_tag_1_packet
494 * @crypt_stat: The cryptographic context to modify based on packet 487 * @crypt_stat: The cryptographic context to modify based on packet