Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e0869cc144174c5e3e2671cb40fdecac44d71855
Commit:     e0869cc144174c5e3e2671cb40fdecac44d71855
Parent:     f4aad16adfb8f0a2d666fdf8af4bd0dff2ce75e4
Author:     Michael Halcrow <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 01:27:55 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 09:43:10 2007 -0700

    eCryptfs: use list_for_each_entry_safe() when wiping auth toks
    
    Use list_for_each_entry_safe() when wiping the authentication token list.
    
    Signed-off-by: Michael Halcrow <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/ecryptfs/keystore.c |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
index a1764fe..8eb0746 100644
--- a/fs/ecryptfs/keystore.c
+++ b/fs/ecryptfs/keystore.c
@@ -469,26 +469,19 @@ out:
 
 static void wipe_auth_tok_list(struct list_head *auth_tok_list_head)
 {
-       struct list_head *walker;
        struct ecryptfs_auth_tok_list_item *auth_tok_list_item;
+       struct ecryptfs_auth_tok_list_item *auth_tok_list_item_tmp;
 
-       walker = auth_tok_list_head->next;
-       while (walker != auth_tok_list_head) {
-               auth_tok_list_item =
-                   list_entry(walker, struct ecryptfs_auth_tok_list_item,
-                              list);
-               walker = auth_tok_list_item->list.next;
-               memset(auth_tok_list_item, 0,
-                      sizeof(struct ecryptfs_auth_tok_list_item));
+       list_for_each_entry_safe(auth_tok_list_item, auth_tok_list_item_tmp,
+                                auth_tok_list_head, list) {
+               list_del(&auth_tok_list_item->list);
                kmem_cache_free(ecryptfs_auth_tok_list_item_cache,
                                auth_tok_list_item);
        }
-       auth_tok_list_head->next = NULL;
 }
 
 struct kmem_cache *ecryptfs_auth_tok_list_item_cache;
 
-
 /**
  * parse_tag_1_packet
  * @crypt_stat: The cryptographic context to modify based on packet
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to