]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
USB: xhci: dbc: fix tty registration race
authorJohan Hovold <johan@kernel.org>
Fri, 8 Oct 2021 09:25:45 +0000 (12:25 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Oct 2021 05:42:18 +0000 (07:42 +0200)
commit880de403777376e50bdf60def359fa50a722006f
treec92062b33c2b03023f14b9a2f5de5da228c0eda8
parent5255660b208aebfdb71d574f3952cf48392f4306
USB: xhci: dbc: fix tty registration race

Make sure to allocate resources before registering the tty device to
avoid having a racing open() and write() fail to enable rx or
dereference a NULL pointer when accessing the uninitialised fifo.

Fixes: dfba2174dc42 ("usb: xhci: Add DbC support in xHCI driver")
Cc: stable@vger.kernel.org # 4.16
Cc: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20211008092547.3996295-4-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-dbgtty.c