mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
usb: gadget zero timer init fix
Initialize timer earlier so if an error occurs allocating USB request or buffer request (zero_bind) Gadget Zero will not hang trying to delete an uninitialized timer (zero_unbind). Signed-off-by: David Lopo <[email protected]> Signed-off-by: David Brownell <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
7472f38b10
commit
7a6ad1dd86
1 changed files with 4 additions and 3 deletions
|
|
@ -1134,6 +1134,10 @@ autoconf_fail:
|
|||
dev->gadget = gadget;
|
||||
set_gadget_data(gadget, dev);
|
||||
|
||||
init_timer(&dev->resume);
|
||||
dev->resume.function = zero_autoresume;
|
||||
dev->resume.data = (unsigned long) dev;
|
||||
|
||||
/* preallocate control response and buffer */
|
||||
dev->req = usb_ep_alloc_request(gadget->ep0, GFP_KERNEL);
|
||||
if (!dev->req)
|
||||
|
|
@ -1165,9 +1169,6 @@ autoconf_fail:
|
|||
|
||||
usb_gadget_set_selfpowered(gadget);
|
||||
|
||||
init_timer(&dev->resume);
|
||||
dev->resume.function = zero_autoresume;
|
||||
dev->resume.data = (unsigned long) dev;
|
||||
if (autoresume) {
|
||||
source_sink_config.bmAttributes |= USB_CONFIG_ATT_WAKEUP;
|
||||
loopback_config.bmAttributes |= USB_CONFIG_ATT_WAKEUP;
|
||||
|
|
|
|||
Loading…
Reference in a new issue