Commit f45f8af
media: uvcvideo: Enforce alignment of frame and interval
[ Upstream commit c8931ef ]
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>1 parent b557ccd commit f45f8af
1 file changed
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
687 | 687 | | |
688 | 688 | | |
689 | 689 | | |
690 | | - | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
691 | 698 | | |
| 699 | + | |
692 | 700 | | |
693 | | - | |
| 701 | + | |
694 | 702 | | |
695 | 703 | | |
696 | 704 | | |
697 | 705 | | |
698 | | - | |
699 | | - | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
700 | 710 | | |
701 | 711 | | |
702 | 712 | | |
| |||
0 commit comments