staging: lustre: libcfs: fix memort leak in libcfs crypto layer
authorJames Simmons <jsimmons@infradead.org>
Mon, 9 May 2016 14:53:47 +0000 (10:53 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Jun 2016 05:38:19 +0000 (22:38 -0700)
During code review Boyko discovered a memory leak. This
patch fixes that leak.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4423
Reviewed-on: http://review.whamcloud.com/19716
Reviewed-by: Alexander Boyko <alexander.boyko@seagate.com>
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lnet/libcfs/linux/linux-crypto.c

index 84f9b7b4758115fcbb5d914c34a929efbc25bfe6..5c0116ade90949caa46e2c077cfec870e39b7b3e 100644 (file)
@@ -99,6 +99,7 @@ static int cfs_crypto_hash_alloc(enum cfs_crypto_hash_alg hash_alg,
                                         (*type)->cht_size);
 
        if (err != 0) {
+               ahash_request_free(*req);
                crypto_free_ahash(tfm);
                return err;
        }