]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: cdns3: fix incorrect calculation of ep_buf_size when more than one config
authorFrank Li <Frank.Li@nxp.com>
Fri, 7 Jul 2023 23:00:15 +0000 (19:00 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Aug 2023 08:22:42 +0000 (10:22 +0200)
commitcd2d96c4bc6fffcc2d7f03fb95efd8b936174820
tree5cc2e74ce3be4e2b2dc40ac1279a81c984f0d399
parent3af06a8502ee9f77876d3cf63af5c8be2a945d99
usb: cdns3: fix incorrect calculation of ep_buf_size when more than one config

commit 2627335a1329a0d39d8d277994678571c4f21800 upstream.

Previously, the cdns3_gadget_check_config() function in the cdns3 driver
mistakenly calculated the ep_buf_size by considering only one
configuration's endpoint information because "claimed" will be clear after
call usb_gadget_check_config().

The fix involves checking the private flags EP_CLAIMED instead of relying
on the "claimed" flag.

Fixes: dce49449e04f ("usb: cdns3: allocate TX FIFO size according to composite EP number")
Cc: stable <stable@kernel.org>
Reported-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Acked-by: Peter Chen <peter.chen@kernel.org>
Tested-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Link: https://lore.kernel.org/r/20230707230015.494999-2-Frank.Li@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/cdns3/cdns3-gadget.c