diff options
author | Cyrille Pitchen <cyrille.pitchen@atmel.com> | 2017-02-09 17:51:21 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2017-02-15 13:23:33 +0800 |
commit | 19998acb0ff67cb8843668f3b94bdbe6018fa7d8 (patch) | |
tree | 30c4a789fee823f608a4496661d05e3094dd955e /drivers/crypto/ccp/ccp-dev-v5.c | |
parent | dd3f9f40b58168f91f27ab686c7bae1f35edd3d4 (diff) | |
download | talos-op-linux-19998acb0ff67cb8843668f3b94bdbe6018fa7d8.tar.gz talos-op-linux-19998acb0ff67cb8843668f3b94bdbe6018fa7d8.zip |
crypto: atmel-sha - fix error management in atmel_sha_start()
This patch clarifies and fixes how errors should be handled by
atmel_sha_start().
For update operations, the previous code wrongly assumed that
(err != -EINPROGRESS) implies (err == 0). It's wrong because that doesn't
take the error cases (err < 0) into account.
This patch also adds many comments to detail all the possible returned
values and what should be done in each case.
Especially, when an error occurs, since atmel_sha_complete() has already
been called, hence releasing the hardware, atmel_sha_start() must not call
atmel_sha_finish_req() later otherwise atmel_sha_complete() would be
called a second time.
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/ccp/ccp-dev-v5.c')
0 files changed, 0 insertions, 0 deletions