Skip to content

Commit

Permalink
io_edgeport: Fix various bogus returns to the tty layer
Browse files Browse the repository at this point in the history
The edgeport reports negative error codes to functions that do not
expect them. This can cause ports to jam forever

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Alan Cox authored and Linus Torvalds committed Jul 22, 2008
1 parent 03f0dbf commit d76f2f4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/usb/serial/io_edgeport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1404,15 +1404,15 @@ static int edge_write_room(struct tty_struct *tty)
dbg("%s", __func__);

if (edge_port == NULL)
return -ENODEV;
return 0;
if (edge_port->closePending)
return -ENODEV;
return 0;

dbg("%s - port %d", __func__, port->number);

if (!edge_port->open) {
dbg("%s - port not opened", __func__);
return -EINVAL;
return 0;
}

/* total of both buffers is still txCredit */
Expand Down Expand Up @@ -1444,13 +1444,13 @@ static int edge_chars_in_buffer(struct tty_struct *tty)
dbg("%s", __func__);

if (edge_port == NULL)
return -ENODEV;
return 0;
if (edge_port->closePending)
return -ENODEV;
return 0;

if (!edge_port->open) {
dbg("%s - port not opened", __func__);
return -EINVAL;
return 0;
}

spin_lock_irqsave(&edge_port->ep_lock, flags);
Expand Down

0 comments on commit d76f2f4

Please sign in to comment.