WSL2-Linux-Kernel/drivers/media/common
Hans Verkuil 22d800b378 media: videobuf2-core: take mmap_lock in vb2_get_unmapped_area()
[ Upstream commit 098e5edc5d ]

While vb2_mmap took the mmap_lock mutex, vb2_get_unmapped_area didn't.
Add this.

Also take this opportunity to move the 'q->memory != VB2_MEMORY_MMAP'
check and vb2_fileio_is_active() check into __find_plane_by_offset() so
both vb2_mmap and vb2_get_unmapped_area do the same checks.

Since q->memory is checked while mmap_lock is held, also take that lock
in reqbufs and create_bufs when it is set, and set it back to
MEMORY_UNKNOWN on error.

Fixes: f035eb4e97 ("[media] videobuf2: fix lockdep warning")
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-14 11:37:19 +01:00
..
b2c2
saa7146
siano
v4l2-tpg
videobuf2 media: videobuf2-core: take mmap_lock in vb2_get_unmapped_area() 2022-12-14 11:37:19 +01:00
Kconfig
Makefile
btcx-risc.h
cx2341x.c
cypress_firmware.c
cypress_firmware.h
ttpci-eeprom.c
ttpci-eeprom.h
tveeprom.c