]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: f_uac2: validate input parameters
authorRuslan Bilovol <ruslan.bilovol@gmail.com>
Mon, 1 Mar 2021 11:49:33 +0000 (13:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Mar 2021 11:54:56 +0000 (12:54 +0100)
commita59f9257f1f4e7c7e78ffdb983041991c9d325a1
treec5c620f01c385c2fcec4c9e61ca85095e85f4842
parentcaef0e9b98c45df56949c6653d385a49b5910fd1
usb: gadget: f_uac2: validate input parameters

Currently user can configure UAC2 function with
parameters that violate UAC2 spec or are not supported
by UAC2 gadget implementation.

This can lead to incorrect behavior if such gadget
is connected to the host - like enumeration failure
or other issues depending on host's UAC2 driver
implementation, bringing user to a long hours
of debugging the issue.

Instead of silently accept these parameters, throw
an error if they are not valid.

Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Link: https://lore.kernel.org/r/1614599375-8803-4-git-send-email-ruslan.bilovol@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/f_uac2.c