udmabuf: set read/write flag when exporting

Otherwise, mmap fails when done with PROT_WRITE.

Suggested-by: Gurchetan Singh <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
Tested-by: Gurchetan Singh <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
This commit is contained in:
Gerd Hoffmann 2018-11-14 13:20:29 +01:00
commit 5c074eeabb

View file

@ -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)) {