diff options
author | Hans de Goede <hdegoede@redhat.com> | 2014-09-20 16:54:35 +0200 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2014-10-06 14:50:43 +0200 |
commit | 6e78c74f62ebfa378d1a2f9b83423b23545c28bf (patch) | |
tree | a1822c0772256b3b6b14ac55a08839b4c5bc40be /include/stdio_dev.h | |
parent | 0ea09dfe873657df47d83d5d4e0090bbf05c6abb (diff) | |
download | u-boot-imx-6e78c74f62ebfa378d1a2f9b83423b23545c28bf.zip u-boot-imx-6e78c74f62ebfa378d1a2f9b83423b23545c28bf.tar.gz u-boot-imx-6e78c74f62ebfa378d1a2f9b83423b23545c28bf.tar.bz2 |
usb: kbd: On a "usb reset" call usb_kbd_deregister() before calling usb_stop()
We need to call usb_kbd_deregister() before calling usb_stop().
usbkbd's stdio_dev->priv points to the usb_device, and usb_kbd_testc
dereferences usb_device->privptr.
usb_stop zeros usb_device, leaving usb_device->privptr NULL, causing
bad things (tm) to happen once control returns to the main loop and
usb_kbd_testc gets called.
Calling usb_kbd_deregister() avoids this. Note that we do not allow
the "usb reset" to continue when the deregister fails. This will be fixed
in a later patch.
For the same reasons always fail "usb stop" if the usb_kbd_deregister() fails,
even in the force path. This can happen when CONFIG_SYS_STDIO_DEREGISTER is
not set.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'include/stdio_dev.h')
0 files changed, 0 insertions, 0 deletions