summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2018-11-14 13:20:29 +0100
committerGerd Hoffmann <kraxel@redhat.com>2018-11-16 08:50:53 +0100
commit5c074eeabbd332b11559f7fc1e89d456f94801fb (patch)
treedcd9cb8d2ca28efa019a418594150aea703f6c20
parentfcc86cb45d38ca2f24bcea9c29c7f4742041caed (diff)
udmabuf: set read/write flag when exporting
Otherwise, mmap fails when done with PROT_WRITE. Suggested-by: Gurchetan Singh <gurchetansingh@chromium.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> Tested-by: Gurchetan Singh <gurchetansingh@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/20181114122029.16766-1-kraxel@redhat.com
-rw-r--r--drivers/dma-buf/udmabuf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c
index 5b44ef226904..fc359ca4503d 100644
--- a/drivers/dma-buf/udmabuf.c
+++ b/drivers/dma-buf/udmabuf.c
@@ -184,6 +184,7 @@ static long udmabuf_create(const struct udmabuf_create_list *head,
exp_info.ops = &udmabuf_ops;
exp_info.size = ubuf->pagecount << PAGE_SHIFT;
exp_info.priv = ubuf;
+ exp_info.flags = O_RDWR;
buf = dma_buf_export(&exp_info);
if (IS_ERR(buf)) {