crypto: cavium - fix memory leak on info
authorColin Ian King <colin.king@canonical.com>
Wed, 15 Nov 2017 12:37:19 +0000 (12:37 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Mar 2018 07:42:49 +0000 (08:42 +0100)
commit919ba939de1a2778376b41cba5163be7e76129d1
tree47272621c57088096e1c1d160e829161c492ec59
parent90cf769aeb5a0a8bd9a24beafb83d97ee49002af
crypto: cavium - fix memory leak on info

[ Upstream commit 87aae50af730a28dc1d8846d86dca5e9aa724a9f ]

The object info is being leaked on an error return path, fix this
by setting ret to -ENOMEM and exiting via the request_cleanup path
that will free info.

Detected by CoverityScan, CID#1408439 ("Resource Leak")

Fixes: c694b233295b ("crypto: cavium - Add the Virtual Function driver for CPT")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/cavium/cpt/cptvf_reqmanager.c