Skip to content

Commit 00fcf2c

Browse files
hnaztorvalds
authored andcommitted
ecryptfs: use kzfree()
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>
1 parent e280180 commit 00fcf2c

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

‎fs/ecryptfs/keystore.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,8 +740,7 @@ ecryptfs_write_tag_70_packet(char *dest, size_t *remaining_bytes,
740740
out_release_free_unlock:
741741
crypto_free_hash(s->hash_desc.tfm);
742742
out_free_unlock:
743-
memset(s->block_aligned_filename, 0, s->block_aligned_filename_size);
744-
kfree(s->block_aligned_filename);
743+
kzfree(s->block_aligned_filename);
745744
out_unlock:
746745
mutex_unlock(s->tfm_mutex);
747746
out:

‎fs/ecryptfs/messaging.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,7 @@ int ecryptfs_exorcise_daemon(struct ecryptfs_daemon *daemon)
291291
if (daemon->user_ns)
292292
put_user_ns(daemon->user_ns);
293293
mutex_unlock(&daemon->mux);
294-
memset(daemon, 0, sizeof(*daemon));
295-
kfree(daemon);
294+
kzfree(daemon);
296295
out:
297296
return rc;
298297
}

0 commit comments

Comments
 (0)