]> git.baikalelectronics.ru Git - kernel.git/commit
usb: dwc3: avoid NULL access of usb_gadget_driver
authorLinyu Yuan <linyyuan@codeaurora.org>
Tue, 29 Jun 2021 01:51:18 +0000 (09:51 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Jul 2021 07:47:32 +0000 (09:47 +0200)
commit31fae1898ccb3941dd07f54dbbea0fb047156c83
tree9ec26332f5b23181bcf315b7e01f2909cdfe3d09
parentf04ca2f99affca71ac47a9309ef8d082d15621aa
usb: dwc3: avoid NULL access of usb_gadget_driver

we found crash in dwc3_disconnect_gadget(),
it is because dwc->gadget_driver become NULL before async access.
89766a8d9425 ('USB: UDC core: Add udc_async_callbacks gadget op')
suggest a common way to avoid such kind of issue.

this change implment the callback in dwc3 and
change related functions which have callback to usb gadget driver.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Linyu Yuan <linyyuan@codeaurora.org>
Link: https://lore.kernel.org/r/20210629015118.7944-1-linyyuan@codeaurora.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/core.h
drivers/usb/dwc3/ep0.c
drivers/usb/dwc3/gadget.c