OSDN Git Service

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)
committerFelipe Balbi <balbi@kernel.org>
Fri, 24 Jul 2020 13:45:14 +0000 (16:45 +0300)
commita95bdfd22076497288868c028619bc5995f5cc7f
treebc47bd6e94098848c39ff755273d7d18d93b4ab4
parent4e3a765ba03c065e5ee71ea309f1933102af7a33
bdc: Fix bug causing crash after multiple disconnects

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>
drivers/usb/gadget/udc/bdc/bdc_core.c
drivers/usb/gadget/udc/bdc/bdc_ep.c