summaryrefslogtreecommitdiff
path: root/drivers/dma-buf
diff options
context:
space:
mode:
authorMaxime Ripard <maxime@cerno.tech>2022-07-13 10:33:00 +0200
committerMaxime Ripard <maxime@cerno.tech>2022-07-13 10:33:00 +0200
commit4de395f2c632c31c575f72d49d4f4389c99dab68 (patch)
tree29abd2c05c697f2d6bde19c10064c49246253828 /drivers/dma-buf
parentbbd60fee2d2166b2b8722cbad740996ef2e7ce40 (diff)
parent0180290abb5ce5c870f84a00ffeda5802f641dce (diff)
downloadlwn-4de395f2c632c31c575f72d49d4f4389c99dab68.tar.gz
lwn-4de395f2c632c31c575f72d49d4f4389c99dab68.zip
Merge drm/drm-next into drm-misc-next
I need to have some vc4 patches merged in -rc4, but drm-misc-next is only at -rc2 for now. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Diffstat (limited to 'drivers/dma-buf')
-rw-r--r--drivers/dma-buf/udmabuf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c
index 384cb3d06ff3..38e8767ec371 100644
--- a/drivers/dma-buf/udmabuf.c
+++ b/drivers/dma-buf/udmabuf.c
@@ -32,8 +32,11 @@ static vm_fault_t udmabuf_vm_fault(struct vm_fault *vmf)
{
struct vm_area_struct *vma = vmf->vma;
struct udmabuf *ubuf = vma->vm_private_data;
+ pgoff_t pgoff = vmf->pgoff;
- vmf->page = ubuf->pages[vmf->pgoff];
+ if (pgoff >= ubuf->pagecount)
+ return VM_FAULT_SIGBUS;
+ vmf->page = ubuf->pages[pgoff];
get_page(vmf->page);
return 0;
}