提交 64d129ca 编写于 作者: T tanghui20 提交者: Xie XiuQi

ACC: Fix bug in review

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

Feature or Bugfix:Bugfix
Signed-off-by: Ntanghui20 <tanghui20@huawei.com>
Reviewed-by: Nxuzaibo <xuzaibo@huawei.com>
Reviewed-by: NZhou Wang <wangzhou1@hisilicon.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 cd0b7aa6
......@@ -495,6 +495,10 @@ static int hpre_dh_set_params(struct hpre_ctx *ctx, struct dh *params)
struct device *dev = &GET_DEV(ctx);
unsigned int sz;
#define _HPRE_DH_MAX_P_SZ 512
if (params->p_size > _HPRE_DH_MAX_P_SZ)
return -EINVAL;
if (hpre_dh_check_params_length(params->p_size <<
HPRE_BITS_2_BYTES_SHIFT))
return -EINVAL;
......
......@@ -1019,6 +1019,7 @@ static const struct file_operations qm_regs_fops = {
.owner = THIS_MODULE,
.open = qm_regs_open,
.read = seq_read,
.release = single_release,
};
static int qm_create_debugfs_file(struct hisi_qm *qm, enum qm_debug_file index)
......@@ -1674,13 +1675,14 @@ static int hisi_qm_uacce_mmap(struct uacce_queue *q,
switch (qfr->type) {
case UACCE_QFRT_MMIO:
/* Try to mmap corresponding pages size region */
if (qm->ver == QM_HW_V2)
WARN_ON(sz > PAGE_SIZE * (QM_DOORBELL_PAGE_NR +
QM_V2_DOORBELL_OFFSET / PAGE_SIZE));
else
WARN_ON(sz > PAGE_SIZE * QM_DOORBELL_PAGE_NR);
if (qm->ver == QM_HW_V2) {
if (WARN_ON(sz > PAGE_SIZE * (QM_DOORBELL_PAGE_NR +
QM_V2_DOORBELL_OFFSET / PAGE_SIZE)))
return -EINVAL;
} else {
if (WARN_ON(sz > PAGE_SIZE * QM_DOORBELL_PAGE_NR))
return -EINVAL;
}
vma->vm_flags |= VM_IO;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册