From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Tue, 16 Feb 2021 16:57:33 -0500 Subject: [PATCH v1 11/11] usb: kbd: destroy device after console is stopped In-Reply-To: <20210211150944.73252-11-andriy.shevchenko@linux.intel.com> References: <20210211150944.73252-1-andriy.shevchenko@linux.intel.com> <20210211150944.73252-11-andriy.shevchenko@linux.intel.com> Message-ID: <20210216215733.GW10169@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > Signed-off-by: Andy Shevchenko 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: