driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IDBQ74 ---------------------------------------------------------------------- vma->vm_pgoff has the unit of PAGE_SIZE, this variable is used to represent the offset in mapped file in pages' granuality. The check here is non-sense, and should be shreded. Fixes: e6ecc3b028b8 ("soc cache: Add framework driver for HiSilicon SoC cache") Signed-off-by: Yushan Wang <wangyushan12@huawei.com> Signed-off-by: Hongye Lin <linhongye@h-partners.com> --- drivers/soc/hisilicon/hisi_soc_cache_framework.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/soc/hisilicon/hisi_soc_cache_framework.c b/drivers/soc/hisilicon/hisi_soc_cache_framework.c index 67b3b306664d..a8903e535e0b 100644 --- a/drivers/soc/hisilicon/hisi_soc_cache_framework.c +++ b/drivers/soc/hisilicon/hisi_soc_cache_framework.c @@ -423,11 +423,6 @@ static int hisi_soc_cache_mmap(struct file *file, struct vm_area_struct *vma) if (ret) goto out_clr; - if (vma->vm_pgoff > PAGE_SIZE) { - ret = -EINVAL; - goto out_clr; - } - ret = remap_pfn_range(vma, vma->vm_start, (addr >> PAGE_SHIFT) + vma->vm_pgoff, size, vma->vm_page_prot); -- 2.33.0