diff --git a/drivers/char/adsprpc.c b/drivers/char/adsprpc.c index e0404a3bd918..179be6df613a 100644 --- a/drivers/char/adsprpc.c +++ b/drivers/char/adsprpc.c @@ -2397,7 +2397,7 @@ static int get_args(uint32_t kernel, struct smq_invoke_ctx *ctx) } offset = buf_page_start(buf) - vma->vm_start; up_read(¤t->mm->mmap_sem); - VERIFY(err, offset < (uintptr_t)map->size); + VERIFY(err, offset + len <= (uintptr_t)map->size); if (err) { ADSPRPC_ERR( "buffer address is invalid for the fd passed for %d address 0x%llx and size %zu\n",