From e2fc6edd37ba487c64f4dd09f7118b3e45b12d88 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 28 Nov 2022 08:23:56 +0000 Subject: media: videobuf2: revert "get_userptr: buffers are always writable" Commit 707947247e95 ("media: videobuf2-vmalloc: get_userptr: buffers are always writable") caused problems in a corner case (passing read-only shmem memory as a userptr). So revert this patch. The original problem for which that commit was originally made is something that I could not reproduce after reverting it. So just go back to the way it was for many years, and if problems arise in the future, then another approach should be taken to resolve it. This patch is based on a patch from Hirokazu. Fixes: 707947247e95 ("media: videobuf2-vmalloc: get_userptr: buffers are always writable") Signed-off-by: Hirokazu Honda Signed-off-by: Hans Verkuil Acked-by: Tomasz Figa Signed-off-by: Mauro Carvalho Chehab --- include/media/videobuf2-memops.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/media/videobuf2-memops.h') diff --git a/include/media/videobuf2-memops.h b/include/media/videobuf2-memops.h index cd4a46331531..4b5b84f93538 100644 --- a/include/media/videobuf2-memops.h +++ b/include/media/videobuf2-memops.h @@ -34,7 +34,8 @@ struct vb2_vmarea_handler { extern const struct vm_operations_struct vb2_common_vm_ops; struct frame_vector *vb2_create_framevec(unsigned long start, - unsigned long length); + unsigned long length, + bool write); void vb2_destroy_framevec(struct frame_vector *vec); #endif -- cgit v1.2.3