This is a note to let you know that I've just added the patch titled USB: serial: fix tty-device error handling at probe to the 3.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: usb-serial-fix-tty-device-error-handling-at-probe.patch and it can be found in the queue-3.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From ca4383a3947a83286bc9b9c598a1f55e867871d7 Mon Sep 17 00:00:00 2001 From: Johan Hovold <johan@xxxxxxxxxx> Date: Wed, 18 Feb 2015 10:34:51 +0700 Subject: USB: serial: fix tty-device error handling at probe From: Johan Hovold <johan@xxxxxxxxxx> commit ca4383a3947a83286bc9b9c598a1f55e867871d7 upstream. Add missing error handling when registering the tty device at port probe. This avoids trying to remove an uninitialised character device when the port device is removed. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Takashi Iwai <tiwai@xxxxxxx> Signed-off-by: Johan Hovold <johan@xxxxxxxxxx> Acked-by: Greg Kroah-Hartman <greg@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/usb/serial/bus.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) --- a/drivers/usb/serial/bus.c +++ b/drivers/usb/serial/bus.c @@ -51,6 +51,7 @@ static int usb_serial_device_probe(struc { struct usb_serial_driver *driver; struct usb_serial_port *port; + struct device *tty_dev; int retval = 0; int minor; @@ -80,7 +81,15 @@ static int usb_serial_device_probe(struc } minor = port->minor; - tty_register_device(usb_serial_tty_driver, minor, dev); + tty_dev = tty_register_device(usb_serial_tty_driver, minor, dev); + if (IS_ERR(tty_dev)) { + retval = PTR_ERR(tty_dev); + device_remove_file(dev, &dev_attr_port_number); + if (driver->port_remove) + driver->port_remove(port); + goto exit_with_autopm; + } + dev_info(&port->serial->dev->dev, "%s converter now attached to ttyUSB%d\n", driver->description, minor); Patches currently in stable-queue which might be from johan@xxxxxxxxxx are queue-3.19/revert-usb-serial-make-bulk_out_size-a-lower-limit.patch queue-3.19/usb-serial-fix-infinite-wait_until_sent-timeout.patch queue-3.19/usb-serial-cp210x-adding-seletek-device-id-s.patch queue-3.19/tty-fix-tty_wait_until_sent-on-64-bit-machines.patch queue-3.19/usb-ftdi_sio-add-jtag-quirk-support-for-cyber-cortex-av-boards.patch queue-3.19/usb-mxuport-fix-null-deref-when-used-as-a-console.patch queue-3.19/usb-ftdi_sio-add-pids-for-actisense-usb-devices.patch queue-3.19/usb-serial-fix-potential-use-after-free-after-failed-probe.patch queue-3.19/net-irda-fix-wait_until_sent-poll-timeout.patch queue-3.19/usb-serial-fix-tty-device-error-handling-at-probe.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html