summaryrefslogtreecommitdiff
path: root/crypto/crc32c_generic.c
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2014-03-14 02:37:06 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2014-03-21 21:54:22 +0800
commit5acd1dd75912763db76eecfa14ce563ea6ec310d (patch)
treecc804d371adb099abfedb76c7ff4ae02d6a7ce1e /crypto/crc32c_generic.c
parentb1e099df78cee8f7789a2808ac055f34d8723e42 (diff)
downloadlinux-crypto-5acd1dd75912763db76eecfa14ce563ea6ec310d.tar.gz
linux-crypto-5acd1dd75912763db76eecfa14ce563ea6ec310d.zip
crypto: hash - Simplify the ahash_finup implementation
The ahash_def_finup() can make use of the request save/restore functions, thus make it so. This simplifies the code a little and unifies the code paths. Note that the same remark about free()ing the req->priv applies here, the req->priv can only be free()'d after the original request was restored. Finally, squash a bug in the invocation of completion in the ASYNC path. In both ahash_def_finup_done{1,2}, the function areq->base.complete(X, err); was called with X=areq->base.data . This is incorrect , as X=&areq->base is the correct value. By analysis of the data structures, we see the areq is of type 'struct ahash_request' , areq->base is of type 'struct crypto_async_request' and areq->base.completion is of type crypto_completion_t, which is defined in include/linux/crypto.h as: typedef void (*crypto_completion_t)(struct crypto_async_request *req, int err); This is one lead that the X should be &areq->base . Next up, we can inspect other code which calls the completion callback to give us kind-of statistical idea of how this callback is used. We can try: $ git grep base\.complete\( drivers/crypto/ Finally, by inspecting ahash_request_set_callback() implementation defined in include/crypto/hash.h , we observe that the .data entry of 'struct crypto_async_request' is intended for arbitrary data, not for completion argument. Signed-off-by: Marek Vasut <marex@denx.de> Cc: David S. Miller <davem@davemloft.net> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Herbert Xu <herbert@gondor.apana.org.au> Cc: Shawn Guo <shawn.guo@linaro.org> Cc: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions