mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-13 07:31:07 +00:00
vb2_read() and vb2_write() return size_t, but propagate
negative errno values from __vb2_perform_fileio().
This relies on implicit signed/unsigned conversions in callers
(e.g. vb2_fop_read()) to recover error codes:
__vb2_perform_fileio() -> -EINVAL
vb2_read() -> (size_t)-EINVAL
vb2_fop_read() -> -EINVAL
This relies on implicit conversions that are not obvious.
These helpers are exported (EXPORT_SYMBOL_GPL) and part of the
vb2 API, so changing their return type may affect existing users.
However, they conceptually follow read/write semantics, where
ssize_t is typically used to return either a byte count or a
negative error code.
Switch vb2_read() and vb2_write() to ssize_t, and update
__vb2_perform_fileio() accordingly.
Signed-off-by: Zile Xiong <xiongzile99@gmail.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Fixes:
|
History
|
|
|---|---|---|
| .. | ||
| frame_vector.c | ||
| Kconfig | ||
| Makefile | ||
| vb2-trace.c | ||
| videobuf2-core.c | ||
| videobuf2-dma-contig.c | ||
| videobuf2-dma-sg.c | ||
| videobuf2-dvb.c | ||
| videobuf2-memops.c | ||
| videobuf2-v4l2.c | ||
| videobuf2-vmalloc.c | ||