USB: serial: fix tty-device error handling at probe
authorJohan Hovold <johan@kernel.org>
Wed, 18 Feb 2015 03:34:51 +0000 (10:34 +0700)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 9 May 2015 22:16:21 +0000 (23:16 +0100)
commitffd9140bd28948bc7a419d92fdd1707db24d60aa
tree2d19d0cdf07117d3084590bcab078c0c4a149c12
parent7f073a838187213d46fdd4bc8f319ad6195165d2
USB: serial: fix tty-device error handling at probe

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@suse.de>
Signed-off-by: Johan Hovold <johan@kernel.org>
Acked-by: Greg Kroah-Hartman <greg@kroah.com>
[bwh: Backported to 3.2:
 - Adjust context
 - No need to clean up autopm]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/serial/bus.c