linux/drivers/media/common/videobuf2
Hans Verkuil 89ab2d3964 media: vb2: frame_vector.c: don't overwrite error code
get_vaddr_frames() first calls pin_user_pages_fast() and if
that fails tries follow_pfn(). But if that also fails, then
the error code from pin_user_pages_fast() is overwritten with
the error code from follow_pfn().

Specifically if pin_user_pages_fast() returns -ENOMEM, then
follow_pfn() will overwrite that with -EINVAL, which is very
confusing.

So store the error code from pin_user_pages_fast() and return
that if follow_pfn() returns -EINVAL. -EINVAL indicates that
the page is unsuitable for follow_pfn, so pin_user_pages_fast()
was the correct call to make, and that error code should be
returned instead.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30 12:07:36 +01:00
..
frame_vector.c media: vb2: frame_vector.c: don't overwrite error code 2021-11-30 12:07:36 +01:00
Kconfig media: videobuf2: Move frame_vector into media subsystem 2021-01-12 14:15:31 +01:00
Makefile media: videobuf2: Move frame_vector into media subsystem 2021-01-12 14:15:31 +01:00
vb2-trace.c media: videobuf2: fix build issues with vb2-trace 2018-02-23 05:13:53 -05:00
videobuf2-core.c Char/Misc driver update for 5.16-rc1 2021-11-04 08:21:47 -07:00
videobuf2-dma-contig.c media: videobuf2: Fix the size printk format 2021-11-15 08:11:31 +00:00
videobuf2-dma-sg.c Char/Misc driver update for 5.16-rc1 2021-11-04 08:21:47 -07:00
videobuf2-dvb.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
videobuf2-memops.c mm/frame-vector: Use FOLL_LONGTERM 2021-01-12 14:15:17 +01:00
videobuf2-v4l2.c media: videobuf2: handle V4L2_MEMORY_FLAG_NON_COHERENT flag 2021-09-30 10:07:57 +02:00
videobuf2-vmalloc.c Char/Misc driver update for 5.16-rc1 2021-11-04 08:21:47 -07:00