linux/drivers/media
Hans Verkuil 098e5edc5d media: videobuf2-core: take mmap_lock in vb2_get_unmapped_area()
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>
2022-12-07 11:25:40 -08:00
..
cec media fixes for v6.1-rc2 2022-10-22 15:30:15 -07:00
common media: videobuf2-core: take mmap_lock in vb2_get_unmapped_area() 2022-12-07 11:25:40 -08:00
dvb-core media: dvb_vb2: fix possible out of bound access 2022-09-27 10:24:44 +02:00
dvb-frontends media fixes for v6.1-rc2 2022-10-22 15:30:15 -07:00
firewire media: Makefiles: remove extra spaces 2022-03-12 16:59:52 +01:00
i2c media fixes for v6.1-rc2 2022-10-22 15:30:15 -07:00
mc media: mc: convert pipeline funcs to take media_pad 2022-09-24 09:22:30 +02:00
mmc media: media/*/Kconfig: sort entries 2022-03-18 05:58:35 +01:00
pci media fixes for v6.1-rc2 2022-10-22 15:30:15 -07:00
platform media fixes for v6.1-rc2 2022-10-22 15:30:15 -07:00
radio media fixes for v6.1-rc2 2022-10-22 15:30:15 -07:00
rc media: mceusb: set timeout to at least timeout provided 2022-09-24 07:50:42 +02:00
spi media updates for v5.18-rc1 2022-03-23 14:51:35 -07:00
test-drivers media: vivid: set num_in/outputs to 0 if not supported 2022-10-25 16:43:34 +01:00
tuners media fixes for v6.1-rc2 2022-10-22 15:30:15 -07:00
usb media fixes for v6.1-rc2 2022-10-22 15:30:15 -07:00
v4l2-core media: v4l2-dv-timings: add sanity checks for blanking values 2022-10-25 16:39:47 +01:00
Kconfig media: remove reference to CONFIG_EMBEDDED in MEDIA_SUPPORT_FILTER 2022-09-08 18:19:29 +02:00
Makefile media: Makefiles: remove extra spaces 2022-03-12 16:59:52 +01:00