From db24b3d8c447dc85d95d49e1d4adefd4cb63d251 Mon Sep 17 00:00:00 2001 From: Miloslav Trmač Date: Fri, 9 Jul 2010 06:35:08 +0200 Subject: 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. --- cryptodev_cipher.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cryptodev_cipher.c') 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; } } -- cgit