Skip to content

Commit ca85485

Browse files
Paul Fulghumgregkh
authored andcommitted
[PATCH] USB: console: prevent ENODEV on node
Prevent ENODEV on a /dev/ttyUSBx, used as a USB-serial console. From: Paul Fulghum <[email protected]> Signed-off-by: Guennadi Liakhovetski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 57845bd commit ca85485

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/usb/serial/usb-serial.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,12 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
201201

202202
++port->open_count;
203203

204-
if (port->open_count == 1) {
204+
/* set up our port structure making the tty driver
205+
* remember our port object, and us it */
206+
tty->driver_data = port;
207+
port->tty = tty;
205208

206-
/* set up our port structure making the tty driver
207-
* remember our port object, and us it */
208-
tty->driver_data = port;
209-
port->tty = tty;
209+
if (port->open_count == 1) {
210210

211211
/* lock this module before we call it
212212
* this may fail, which means we must bail out,

0 commit comments

Comments
 (0)