]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: gadget: f_uac2: fix AC Interface Header Descriptor wTotalLength
authorRuslan Bilovol <ruslan.bilovol@gmail.com>
Fri, 3 Jul 2020 13:49:03 +0000 (16:49 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:24:00 +0000 (08:24 +0200)
commitebe45ee2542710d0ee71ee7760947cafd58b65b8
tree451a010b8b1d4c597112287f4fe9f784ca56fb99
parente7c4b79d70a70b4b7b0a04c640238a2ef0a7a8c8
usb: gadget: f_uac2: fix AC Interface Header Descriptor wTotalLength

[ Upstream commit a9cf8715180b18c62addbfe6f6267b8101903119 ]

As per UAC2 spec (ch. 4.7.2), wTotalLength of AC Interface
Header Descriptor "includes the combined length of this
descriptor header and all Clock Source, Unit and Terminal
descriptors."

Thus add its size to its wTotalLength.

Also after recent changes wTotalLength is calculated
dynamically, update static definition of uac2_ac_header_descriptor
accordingly

Fixes: 132fcb460839 ("usb: gadget: Add Audio Class 2.0 Driver")
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/gadget/function/f_uac2.c