diff options
| -rw-r--r-- | drivers/soc/qcom/hab/hab_mem_linux.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/soc/qcom/hab/hab_mem_linux.c b/drivers/soc/qcom/hab/hab_mem_linux.c index 428d3e7cee60..5ad945d078c9 100644 --- a/drivers/soc/qcom/hab/hab_mem_linux.c +++ b/drivers/soc/qcom/hab/hab_mem_linux.c @@ -738,7 +738,8 @@ int habmem_imp_hyp_mmap(struct file *filp, struct vm_area_struct *vma) read_lock(&imp_ctx->implist_lock); list_for_each_entry(pglist, &imp_ctx->imp_list, list) { - if (pglist->index == vma->vm_pgoff) { + if ((pglist->index == vma->vm_pgoff) && + ((length <= pglist->npages * PAGE_SIZE))) { bfound = 1; break; } |
