In cryptodev_hash_init, hdata->init is set only after all necessary
allocations succeed. On clean-up it is no longer necessary to make
the same checks again.

Signed-off-by: Cristian Stoica <cristian.sto...@nxp.com>
---
 cryptlib.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/cryptlib.c b/cryptlib.c
index aa03610..a7b5c91 100644
--- a/cryptlib.c
+++ b/cryptlib.c
@@ -362,10 +362,8 @@ error:
 void cryptodev_hash_deinit(struct hash_data *hdata)
 {
        if (hdata->init) {
-               if (hdata->async.request)
-                       ahash_request_free(hdata->async.request);
-               if (hdata->async.s)
-                       crypto_free_ahash(hdata->async.s);
+               ahash_request_free(hdata->async.request);
+               crypto_free_ahash(hdata->async.s);
                hdata->init = 0;
        }
 }
-- 
2.7.0


_______________________________________________
Cryptodev-linux-devel mailing list
Cryptodev-linux-devel@gna.org
https://mail.gna.org/listinfo/cryptodev-linux-devel

Reply via email to