From 6efb9233aa9faef4b2bbbc36bd2a88c7c85791d0 Mon Sep 17 00:00:00 2001 From: Mingqiang Ling Date: Wed, 24 Apr 2019 18:08:52 +0800 Subject: [PATCH] arm64: HPRE CI warning clean and bugfix driver inclusion category: bugfix bugzilla: 13683 CVE: NA ------------------------------------------------- CI warning clean and some real bugs were fixed Feature or Bugfix:Bugfix Signed-off-by: xuzaibo Reviewed-by: fanghao Reviewed-by: wangzhou Signed-off-by: Mingqiang Ling Reviewed-by: Xie XiuQi Signed-off-by: Yang Yingliang --- drivers/crypto/hisilicon/hpre/hpre_crypto.c | 19 +++++++++++-------- drivers/uacce/uacce.c | 4 ++-- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/crypto/hisilicon/hpre/hpre_crypto.c b/drivers/crypto/hisilicon/hpre/hpre_crypto.c index c3df886ec44c..b9d9594482bb 100644 --- a/drivers/crypto/hisilicon/hpre/hpre_crypto.c +++ b/drivers/crypto/hisilicon/hpre/hpre_crypto.c @@ -372,6 +372,7 @@ static int hpre_msg_comm_set(struct hpre_ctx *ctx, void *req, int is_rsa) struct kpp_request *kreq = req; struct akcipher_request *akreq = req; int req_id; + void *tmp; if (!req || !ctx) return -EINVAL; @@ -380,7 +381,8 @@ static int hpre_msg_comm_set(struct hpre_ctx *ctx, void *req, int is_rsa) akreq->dst_len = ctx->key_sz; return -EOVERFLOW; } - h_req = PTR_ALIGN(akcipher_request_ctx(akreq), HPRE_ALIGN_SZ); + tmp = akcipher_request_ctx(akreq); + h_req = PTR_ALIGN(tmp, HPRE_ALIGN_SZ); h_req->cb = _rsa_cb; h_req->areq.rsa = akreq; msg = &h_req->req; @@ -390,7 +392,8 @@ static int hpre_msg_comm_set(struct hpre_ctx *ctx, void *req, int is_rsa) kreq->dst_len = ctx->key_sz; return -EOVERFLOW; } - h_req = PTR_ALIGN(kpp_request_ctx(kreq), HPRE_ALIGN_SZ); + tmp = kpp_request_ctx(kreq); + h_req = PTR_ALIGN(tmp, HPRE_ALIGN_SZ); h_req->cb = _dh_cb; h_req->areq.dh = kreq; msg = &h_req->req; @@ -413,8 +416,8 @@ static int hpre_dh_compute_value(struct kpp_request *req) { struct crypto_kpp *tfm = crypto_kpp_reqtfm(req); struct hpre_ctx *ctx = kpp_tfm_ctx(tfm); - struct hpre_asym_request *hpre_req = - PTR_ALIGN(kpp_request_ctx(req), HPRE_ALIGN_SZ); + void *tmp = kpp_request_ctx(req); + struct hpre_asym_request *hpre_req = PTR_ALIGN(tmp, HPRE_ALIGN_SZ); struct hpre_sqe *msg = &hpre_req->req; int ret; int ctr = 0; @@ -606,8 +609,8 @@ static int hpre_rsa_enc(struct akcipher_request *req) { struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req); struct hpre_ctx *ctx = akcipher_tfm_ctx(tfm); - struct hpre_asym_request *hpre_req = - PTR_ALIGN(akcipher_request_ctx(req), HPRE_ALIGN_SZ); + void *tmp = akcipher_request_ctx(req); + struct hpre_asym_request *hpre_req = PTR_ALIGN(tmp, HPRE_ALIGN_SZ); struct hpre_sqe *msg = &hpre_req->req; int ret; int ctr = 0; @@ -649,8 +652,8 @@ static int hpre_rsa_dec(struct akcipher_request *req) { struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req); struct hpre_ctx *ctx = akcipher_tfm_ctx(tfm); - struct hpre_asym_request *hpre_req = - PTR_ALIGN(akcipher_request_ctx(req), HPRE_ALIGN_SZ); + void *tmp = akcipher_request_ctx(req); + struct hpre_asym_request *hpre_req = PTR_ALIGN(tmp, HPRE_ALIGN_SZ); struct hpre_sqe *msg = &hpre_req->req; int ret; int ctr = 0; diff --git a/drivers/uacce/uacce.c b/drivers/uacce/uacce.c index 44e61b551f5d..1d15fe4f6435 100644 --- a/drivers/uacce/uacce.c +++ b/drivers/uacce/uacce.c @@ -331,8 +331,8 @@ static struct uacce_qfile_region *uacce_create_region(struct uacce_queue *q, qfr->nr_pages << PAGE_SHIFT, &qfr->dma, GFP_KERNEL); if (!qfr->kaddr) { - goto err_with_qfr; ret = -ENOMEM; + goto err_with_qfr; } } else { dev_dbg(uacce->pdev, "allocate %d pages\n", qfr->nr_pages); @@ -996,7 +996,7 @@ uacce_dev_show_algorithms(struct device *dev, { struct uacce *uacce = UACCE_FROM_CDEV_ATTR(dev); - return sprintf(buf, uacce->algs); + return sprintf(buf, "%s", uacce->algs); } static DEVICE_ATTR(algorithms, S_IRUGO, uacce_dev_show_algorithms, NULL); -- GitLab