summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2020-06-11 11:28:13 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2020-06-11 11:28:13 +0000
commitaee8bfcccc3186dc5905e07014cb575b75e49d46 (patch)
treeaab6749d0bf788bfdb0ef8dcbdae9354f2298dc1
parent0a134950a0c0c483bcc44b0ea5787297c12dbceb (diff)
handle sg_set_page() with NULL page argument
should fix problem reported by Laurence Tratt on bugs@ tweak and ok kettenis@
-rw-r--r--sys/dev/pci/drm/include/linux/scatterlist.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pci/drm/include/linux/scatterlist.h b/sys/dev/pci/drm/include/linux/scatterlist.h
index effe1ce499b..43392adbba7 100644
--- a/sys/dev/pci/drm/include/linux/scatterlist.h
+++ b/sys/dev/pci/drm/include/linux/scatterlist.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: scatterlist.h,v 1.2 2020/06/08 04:48:15 jsg Exp $ */
+/* $OpenBSD: scatterlist.h,v 1.3 2020/06/11 11:28:12 jsg Exp $ */
/*
* Copyright (c) 2013, 2014, 2015 Mark Kettenis
*
@@ -115,7 +115,7 @@ sg_set_page(struct scatterlist *sgl, struct vm_page *page,
unsigned int length, unsigned int offset)
{
sgl->__page = page;
- sgl->dma_address = VM_PAGE_TO_PHYS(page);
+ sgl->dma_address = page ? VM_PAGE_TO_PHYS(page) : 0;
sgl->offset = offset;
sgl->length = length;
sgl->end = false;