Skip to content

Commit

Permalink
nfc: s3fwrn5: use crypto_shash_tfm_digest()
Browse files Browse the repository at this point in the history
Instead of manually allocating a 'struct shash_desc' on the stack and
calling crypto_shash_digest(), switch to using the new helper function
crypto_shash_tfm_digest() which does this for us.

Cc: Robert Baldyga <[email protected]>
Cc: Krzysztof Opasiak <[email protected]>
Signed-off-by: Eric Biggers <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
ebiggers authored and herbertx committed May 8, 2020
1 parent ecca1ad commit 96a5aa7
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions drivers/nfc/s3fwrn5/firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,15 +434,7 @@ int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info)
goto out;
}

{
SHASH_DESC_ON_STACK(desc, tfm);

desc->tfm = tfm;

ret = crypto_shash_digest(desc, fw->image, image_size,
hash_data);
shash_desc_zero(desc);
}
ret = crypto_shash_tfm_digest(tfm, fw->image, image_size, hash_data);

crypto_free_shash(tfm);
if (ret) {
Expand Down

0 comments on commit 96a5aa7

Please sign in to comment.