[PATCH v1 11/11] usb: kbd: destroy device after console is stopped

Tom Rini
2021-02-16T21:57:33Z

On Thu, Feb 11, 2021 at 05:09:44PM +0200, Andy Shevchenko wrote:

> 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: 3cbcb2892809 ("usb: Fix usb_kbd_deregister when console-muxing is used")
> Fixes: 8a8348703081 ("dm: usb: Add a remove() method for USB keyboards")
> Reported-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Applied to u-boot/master, thanks!

--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210216/fb73ddb8/attachment.sig>