Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit b0fb4622 authored by Ricardo Ribalda's avatar Ricardo Ribalda Committed by Vegard Nossum
Browse files

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: default avatarRicardo Ribalda <ribalda@chromium.org>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20240404-uvc-align-v2-1-9e104b0ecfbd@chromium.org


Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
(cherry picked from commit d1a4c613dd3ef57978fc366b4e3d72cd5083a1f9)
[Vegard: fix conflicts due to missing commit
 2c6b222cee2d68e30f059b8ca9194532416bb3f4 ("media: uvcvideo: Use
 internal kernel integer types") and commit
 f14d4988c28e5243e43ba792ee34994951240b0f ("media: uvcvideo: Use
 parentheses around sizeof operand").]
Signed-off-by: default avatarVegard Nossum <vegard.nossum@oracle.com>
parent 4a9d23f1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment