Skip to content
Commit eb5fd9e4 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Tom Rini
Browse files

usb: kbd: destroy device after console is stopped



In case of IOMUX enabled it assumes that console devices in the list
are available to get them stopped properly via ->stop() callback.
However, the USB keyboard driver violates this assumption and tries
to play tricks so the device get destroyed while being listed as
an active console.

Swap the order of device deregistration and IOMUX update along with
converting to use iomux_replace_device() jelper to avoid the use-after-free.

Fixes: 3cbcb289 ("usb: Fix usb_kbd_deregister when console-muxing is used")
Fixes: 8a834870 ("dm: usb: Add a remove() method for USB keyboards")
Reported-by: default avatarNicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parent 694cd561
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment