Skip to content

Commit

Permalink
crypto: jitter - Use kvfree_sensitive() to fix Coccinelle warning
Browse files Browse the repository at this point in the history
Replace memzero_explicit() and kvfree() with kvfree_sensitive() to fix
the following Coccinelle/coccicheck warning reported by
kfree_sensitive.cocci:

	WARNING opportunity for kfree_sensitive/kvfree_sensitive

Signed-off-by: Thorsten Blum <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
toblux authored and herbertx committed Apr 5, 2024
1 parent a00dce0 commit 6e61ee1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crypto/jitterentropy-kcapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ void *jent_kvzalloc(unsigned int len)

void jent_kvzfree(void *ptr, unsigned int len)
{
memzero_explicit(ptr, len);
kvfree(ptr);
kvfree_sensitive(ptr, len);
}

void *jent_zalloc(unsigned int len)
Expand Down

0 comments on commit 6e61ee1

Please sign in to comment.