]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: gadget: f_uac2: Fix incorrect setting of bNumEndpoints
authorPrashanth K <quic_prashk@quicinc.com>
Wed, 11 Dec 2024 11:59:15 +0000 (17:29 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Jan 2025 12:34:45 +0000 (13:34 +0100)
commit9981c33aaeaad2a9c620cc7ff495fd224fe3169e
treec3d5c001c6ed5d3fb6b8dbbd291a32aea76e2e10
parentdc51b66ec291c737783909cc30bece6698df9d66
usb: gadget: f_uac2: Fix incorrect setting of bNumEndpoints

commit 057bd54dfcf68b1f67e6dfc32a47a72e12198495 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: eaf6cbe09920 ("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>
drivers/usb/gadget/function/f_uac2.c