[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160902144753.31334-3-lambert.quentin@gmail.com>
Date: Fri, 2 Sep 2016 16:47:53 +0200
From: Quentin Lambert <lambert.quentin@...il.com>
To: Giovanni Cabiddu <giovanni.cabiddu@...el.com>,
Salvatore Benedetto <salvatore.benedetto@...el.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>, qat-linux@...el.com,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org,
Quentin Lambert <lambert.quentin@...il.com>
Subject: [PATCH v2 2/2] crypto: qat - fix resource release omissions
In certain cases qat_uclo_parse_uof_obj used to return with an error code
before releasing all resources. This patch add a jump to the appropriate label
ensuring that the resources are properly released before returning.
This issue was found with Hector.
Signed-off-by: Quentin Lambert <lambert.quentin@...il.com>
---
drivers/crypto/qat/qat_common/qat_uclo.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/crypto/qat/qat_common/qat_uclo.c
+++ b/drivers/crypto/qat/qat_common/qat_uclo.c
@@ -981,7 +981,8 @@ static int qat_uclo_parse_uof_obj(struct
(PID_MINOR_REV & handle->hal_handle->revision_id);
if (qat_uclo_check_uof_compat(obj_handle)) {
pr_err("QAT: UOF incompatible\n");
- return -EINVAL;
+ ret = -EINVAL;
+ goto out_err;
}
obj_handle->ustore_phy_size = ICP_QAT_UCLO_MAX_USTORE;
if (!obj_handle->obj_hdr->file_buff ||
Powered by blists - more mailing lists