Skip to content

Commit 72635fe

Browse files
Prashanth Kmehmetb0
authored andcommitted
usb: gadget: f_uac2: Fix incorrect setting of bNumEndpoints
BugLink: https://bugs.launchpad.net/bugs/2106770 commit 057bd54 upstream. Currently afunc_bind sets std_ac_if_desc.bNumEndpoints to 1 if controls (mute/volume) are enabled. During next afunc_bind call, bNumEndpoints would be unchanged and incorrectly set to 1 even if the controls aren't enabled. Fix this by resetting the value of bNumEndpoints to 0 on every afunc_bind call. Fixes: eaf6cbe ("usb: gadget: f_uac2: add volume and mute support") Cc: stable <stable@kernel.org> Signed-off-by: Prashanth K <quic_prashk@quicinc.com> Link: https://lore.kernel.org/r/20241211115915.159864-1-quic_prashk@quicinc.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com> Signed-off-by: Mehmet Basaran <mehmet.basaran@canonical.com>
1 parent b52ca79 commit 72635fe

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/usb/gadget/function/f_uac2.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,7 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
11791179
uac2->as_in_alt = 0;
11801180
}
11811181

1182+
std_ac_if_desc.bNumEndpoints = 0;
11821183
if (FUOUT_EN(uac2_opts) || FUIN_EN(uac2_opts)) {
11831184
uac2->int_ep = usb_ep_autoconfig(gadget, &fs_ep_int_desc);
11841185
if (!uac2->int_ep) {

0 commit comments

Comments
 (0)