diff options
author | Miloslav Trmač <mitr@redhat.com> | 2010-07-09 06:35:08 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-07-19 09:23:00 +0200 |
commit | db24b3d8c447dc85d95d49e1d4adefd4cb63d251 (patch) | |
tree | 5aa6755c3b15b10cb0f2a6d268196f7f03bf13a1 | |
parent | ef4808186b9e12eca6b4b640bbfa5f875ae4d1a1 (diff) | |
download | cryptodev-linux-db24b3d8c447dc85d95d49e1d4adefd4cb63d251.tar.gz cryptodev-linux-db24b3d8c447dc85d95d49e1d4adefd4cb63d251.tar.xz cryptodev-linux-db24b3d8c447dc85d95d49e1d4adefd4cb63d251.zip |
Fix cryptodev_hash_deinit
This function may be called even if hdata was never initialized, so only
free the crypto API data structures if they are not NULL.
-rw-r--r-- | cryptodev_cipher.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cryptodev_cipher.c b/cryptodev_cipher.c index 19841e1..a1e61f1 100644 --- a/cryptodev_cipher.c +++ b/cryptodev_cipher.c @@ -273,7 +273,11 @@ error: void cryptodev_hash_deinit(struct hash_data* hdata) { if (hdata->init) { - crypto_free_ahash(hdata->async.s); + if (hdata->async.request) + ahash_request_free(hdata->async.request); + kfree(hdata->async.result); + if (hdata->async.s) + crypto_free_ahash(hdata->async.s); hdata->init = 0; } } |