diff options
author | Steven Price <steven.price@arm.com> | 2023-06-01 11:55:48 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-06-01 14:04:01 +0100 |
commit | d0a396083e91e3f118c90afa95c91f8c243a6c11 (patch) | |
tree | baf4fa3ccf8c923bd6bdf7631173c061736b8e12 /drivers/tty | |
parent | 84a9582fd203063cd4d301204971ff2cd8327f1a (diff) |
serial: core: Don't drop port_mutex in serial_core_remove_one_port
Commit 84a9582fd203 ("serial: core: Start managing serial controllers to
enable runtime PM") required the caller to hold port_mutex rather than
taking it locally. However the mutex_unlock() call wasn't removed
causing the mutex to be dropped unexpectly. Remove the call to
mutex_unlock() (and fix up the early return) to restore correct
behaviour.
Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM")
Signed-off-by: Steven Price <steven.price@arm.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20230601105548.29965-1-steven.price@arm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/serial_core.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 29bd5ede0b25..efda90215ee9 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -3194,7 +3194,7 @@ static void serial_core_remove_one_port(struct uart_driver *drv, if (!uart_port) { mutex_unlock(&port->mutex); - goto out; + return; } mutex_unlock(&port->mutex); @@ -3234,8 +3234,6 @@ static void serial_core_remove_one_port(struct uart_driver *drv, wait_event(state->remove_wait, !atomic_read(&state->refcount)); state->uart_port = NULL; mutex_unlock(&port->mutex); -out: - mutex_unlock(&port_mutex); } /** |