Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354786
b: refs/heads/master
c: b342dd5
h: refs/heads/master
v: v3
  • Loading branch information
Chen Gang authored and Greg Kroah-Hartman committed Jan 16, 2013
1 parent 89548c3 commit d52ec0f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 074d35cebe96da07ac07f78118bc6a09e60350b5
refs/heads/master: b342dd512f7af0e0e14e29c3e1f863150cfc46ff
9 changes: 8 additions & 1 deletion trunk/drivers/tty/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2643,6 +2643,7 @@ int uart_remove_one_port(struct uart_driver *drv, struct uart_port *uport)
{
struct uart_state *state = drv->state + uport->line;
struct tty_port *port = &state->port;
int ret = 0;

BUG_ON(in_interrupt());

Expand All @@ -2657,6 +2658,11 @@ int uart_remove_one_port(struct uart_driver *drv, struct uart_port *uport)
* succeeding while we shut down the port.
*/
mutex_lock(&port->mutex);
if (!state->uart_port) {
mutex_unlock(&port->mutex);
ret = -EINVAL;
goto out;
}
uport->flags |= UPF_DEAD;
mutex_unlock(&port->mutex);

Expand All @@ -2680,9 +2686,10 @@ int uart_remove_one_port(struct uart_driver *drv, struct uart_port *uport)
uport->type = PORT_UNKNOWN;

state->uart_port = NULL;
out:
mutex_unlock(&port_mutex);

return 0;
return ret;
}

/*
Expand Down

0 comments on commit d52ec0f

Please sign in to comment.