Commit c289f3d
committed
usb: uvc: respect setup->wLength in responses
Due to the alignment and granularity requirements of memory allocation,
setup->wLength is shorter than the allocated buffer size.
This lead to responses larger than what the host requested, which it
rejected. Fix it by using the minimum between the allocated size, the
struct size, and the wLength requested.
Signed-off-by: Josuah Demangeon <me@josuah.net>1 parent 26cb178 commit c289f3d
1 file changed
+6
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
694 | 694 | | |
695 | 695 | | |
696 | 696 | | |
697 | | - | |
| 697 | + | |
| 698 | + | |
698 | 699 | | |
699 | 700 | | |
700 | 701 | | |
| |||
912 | 913 | | |
913 | 914 | | |
914 | 915 | | |
915 | | - | |
| 916 | + | |
| 917 | + | |
916 | 918 | | |
917 | 919 | | |
918 | 920 | | |
| |||
1104 | 1106 | | |
1105 | 1107 | | |
1106 | 1108 | | |
1107 | | - | |
| 1109 | + | |
| 1110 | + | |
1108 | 1111 | | |
1109 | 1112 | | |
1110 | 1113 | | |
| |||
0 commit comments