Skip to content

Commit

Permalink
ecryptfs: use kzfree()
Browse files Browse the repository at this point in the history
Use kzfree() instead of memset() + kfree().

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Johannes Weiner authored and Linus Torvalds committed Apr 1, 2009
1 parent e280180 commit 00fcf2c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions fs/ecryptfs/keystore.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,7 @@ ecryptfs_write_tag_70_packet(char *dest, size_t *remaining_bytes,
out_release_free_unlock:
crypto_free_hash(s->hash_desc.tfm);
out_free_unlock:
memset(s->block_aligned_filename, 0, s->block_aligned_filename_size);
kfree(s->block_aligned_filename);
kzfree(s->block_aligned_filename);
out_unlock:
mutex_unlock(s->tfm_mutex);
out:
Expand Down
3 changes: 1 addition & 2 deletions fs/ecryptfs/messaging.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,7 @@ int ecryptfs_exorcise_daemon(struct ecryptfs_daemon *daemon)
if (daemon->user_ns)
put_user_ns(daemon->user_ns);
mutex_unlock(&daemon->mux);
memset(daemon, 0, sizeof(*daemon));
kfree(daemon);
kzfree(daemon);
out:
return rc;
}
Expand Down

0 comments on commit 00fcf2c

Please sign in to comment.