bdc: Fix bug causing crash after multiple disconnects
authorSasi Kumar <sasi.kumar@broadcom.com>
Wed, 22 Jul 2020 17:07:42 +0000 (13:07 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:23:41 +0000 (08:23 +0200)
commit07157bf14a8ec7ba9ea034afc1c5d10b69da1e47
tree642a5f33985447db02812a1590fadf683bbf08ab
parentdb76035ed4770ebc998ef7a9705f0f90940166f4
bdc: Fix bug causing crash after multiple disconnects

[ Upstream commit a95bdfd22076497288868c028619bc5995f5cc7f ]

Multiple connects/disconnects can cause a crash on the second
disconnect. The driver had a problem where it would try to send
endpoint commands after it was disconnected which is not allowed
by the hardware. The fix is to only allow the endpoint commands
when the endpoint is connected. This will also fix issues that
showed up when using configfs to create gadgets.

Signed-off-by: Sasi Kumar <sasi.kumar@broadcom.com>
Signed-off-by: Al Cooper <alcooperx@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/gadget/udc/bdc/bdc_core.c
drivers/usb/gadget/udc/bdc/bdc_ep.c