kernel_samsung_a53x/drivers/media/usb/uvc
Ricardo Ribalda 9ac71d6755 media: uvcvideo: Enforce alignment of frame and interval
[ Upstream commit c8931ef55bd325052ec496f242aea7f6de47dc9c ]

Struct uvc_frame and interval (u32*) are packaged together on
streaming->formats on a single contiguous allocation.

Right now they are allocated right after uvc_format, without taking into
consideration their required alignment.

This is working fine because both structures have a field with a
pointer, but it will stop working when the sizeof() of any of those
structs is not a multiple of the sizeof(void*).

Enforce that alignment during the allocation.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20240404-uvc-align-v2-1-9e104b0ecfbd@chromium.org
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:20:58 +01:00
..
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uvc_ctrl.c media: uvcvideo: Use entity get_cur in uvc_ctrl_set 2024-11-23 23:20:31 +01:00
uvc_debugfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uvc_driver.c media: uvcvideo: Enforce alignment of frame and interval 2024-11-23 23:20:58 +01:00
uvc_entity.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uvc_isight.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uvc_metadata.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uvc_queue.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uvc_status.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uvc_v4l2.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uvc_video.c media: uvcvideo: Fix integer overflow calculating timestamp 2024-11-23 23:20:54 +01:00
uvcvideo.h media: uvcvideo: Allow entity-defined get_info and get_cur 2024-11-23 23:20:09 +01:00