提交 24547c69 编写于 作者: T tanghui20 提交者: Xie XiuQi

hpre:solve view problem from euleros.

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

solve view problem from euleros.

Feature or Bugfix:Bugfix
Signed-off-by: Ntanghui20 <tanghui20@huawei.com>
Reviewed-by: NZhou Wang <wangzhou1@hisilicon.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 22dc4b72
......@@ -216,9 +216,8 @@ static int hpre_prepare_dma_buf(struct hpre_asym_request *hpre_req,
return -EINVAL;
ptr = dma_alloc_coherent(dev, ctx->key_sz, tmp, GFP_KERNEL);
if (!ptr) {
if (!ptr)
return -ENOMEM;
}
if (is_src) {
scatterwalk_map_and_copy(ptr + shift, data, 0, len, 0);
......@@ -838,7 +837,7 @@ static int hpre_crt_para_get(char *para, const char *raw,
size_t len = raw_sz;
hpre_rsa_drop_leading_zeros(&ptr, &len);
if (!len)
if (!len || len > para_size)
return -EINVAL;
memcpy(para + para_size - len, ptr, len);
......@@ -1082,7 +1081,7 @@ static struct kpp_alg dh = {
int hpre_algs_register(void)
{
int ret = EINVAL;
int ret = 0;
mutex_lock(&hpre_alg_lock);
if (++hpre_active_devs == 1) {
......
......@@ -1466,12 +1466,22 @@ static void hpre_reset_done(struct pci_dev *pdev)
}
if (pdev->is_physfn) {
hpre_set_user_domain_and_cache(hpre);
ret = hpre_set_user_domain_and_cache(hpre);
if (ret)
return;
hpre_hw_err_init(hpre);
if (hpre->ctrl->num_vfs)
hpre_vf_q_assign(hpre, hpre->ctrl->num_vfs);
hpre_vf_reset_done(pdev);
ret = hpre_vf_reset_done(pdev);
if (ret) {
dev_err(&pdev->dev, "Failed to start VFs!\n");
return;
}
}
hpre_flr_reset_complete(pdev);
dev_info(dev, "FLR reset complete\n");
......
......@@ -998,7 +998,6 @@ static long uacce_put_queue(struct uacce_queue *q)
* To do: we should vm_munmap mmio and dus regions, currently we munmap
* mmio and dus region before put queue.
*/
if (uacce->ops->stop_queue)
uacce->ops->stop_queue(q);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册