From 687eddcc63ab2a019ef01559da85f6d45aed2875 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Fri, 24 Jan 2020 17:07:09 +1100 Subject: [PATCH] [kvmfr] fixed incorrect buffer size calculation --- VERSION | 2 +- module/kvmfr.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 2aa7afb7..029a663d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -B1-105-ga75b95694b+1 \ No newline at end of file +B1-106-g9d6d137b50+1 \ No newline at end of file diff --git a/module/kvmfr.c b/module/kvmfr.c index b6ad3858..cde97c9c 100644 --- a/module/kvmfr.c +++ b/module/kvmfr.c @@ -199,7 +199,7 @@ static long kvmfr_dmabuf_create(struct kvmfr_dev * kdev, struct file * filp, uns return -ENOMEM; kbuf->kdev = kdev; - kbuf->pagecount = (create.size - create.offset) >> PAGE_SHIFT; + kbuf->pagecount = create.size >> PAGE_SHIFT; kbuf->pages = kmalloc_array(kbuf->pagecount, sizeof(*kbuf->pages), GFP_KERNEL); if (!kbuf->pages) { @@ -436,4 +436,4 @@ module_exit(kvmfr_module_exit); MODULE_DEVICE_TABLE(pci, kvmfr_pci_ids); MODULE_LICENSE("GPL v2"); -MODULE_AUTHOR("Geoffrey McRae"); \ No newline at end of file +MODULE_AUTHOR("Geoffrey McRae");