Skip to content

Commit 057bd54

Browse files
Prashanth Kgregkh
authored andcommitted
usb: gadget: f_uac2: Fix incorrect setting of bNumEndpoints
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 <[email protected]> Signed-off-by: Prashanth K <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b9711ff commit 057bd54

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
@@ -1185,6 +1185,7 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
11851185
uac2->as_in_alt = 0;
11861186
}
11871187

1188+
std_ac_if_desc.bNumEndpoints = 0;
11881189
if (FUOUT_EN(uac2_opts) || FUIN_EN(uac2_opts)) {
11891190
uac2->int_ep = usb_ep_autoconfig(gadget, &fs_ep_int_desc);
11901191
if (!uac2->int_ep) {

0 commit comments

Comments
 (0)