Christophe Leroy
a3c9315a8c
serial: cpm_uart: Avoid suspicious locking
...
[ Upstream commit 36ef11d311f405e55ad8e848c19b212ff71ef536 ]
CHECK drivers/tty/serial/cpm_uart/cpm_uart_core.c
drivers/tty/serial/cpm_uart/cpm_uart_core.c:1271:39: warning: context imbalance in 'cpm_uart_console_write' - unexpected unlock
Allthough 'nolock' is not expected to change, sparse find the following
form suspicious:
if (unlikely(nolock)) {
local_irq_save(flags);
} else {
spin_lock_irqsave(&pinfo->port.lock, flags);
}
cpm_uart_early_write(pinfo, s, count, true);
if (unlikely(nolock)) {
local_irq_restore(flags);
} else {
spin_unlock_irqrestore(&pinfo->port.lock, flags);
}
Rewrite it a more obvious form:
if (unlikely(oops_in_progress)) {
local_irq_save(flags);
cpm_uart_early_write(pinfo, s, count, true);
local_irq_restore(flags);
} else {
spin_lock_irqsave(&pinfo->port.lock, flags);
cpm_uart_early_write(pinfo, s, count, true);
spin_unlock_irqrestore(&pinfo->port.lock, flags);
}
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/f7da5cdc9287960185829cfef681a7d8614efa1f.1691068700.git.christophe.leroy@csgroup.eu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-23 11:11:07 +02:00
..
2023-08-23 17:52:38 +02:00
2023-09-23 11:11:07 +02:00
2022-09-22 16:11:43 +02:00
2022-10-07 16:36:24 -07:00
2022-09-30 14:58:46 +02:00
2022-12-31 13:32:40 +01:00
2022-08-30 14:22:35 +02:00
2023-01-24 07:24:39 +01:00
2022-08-30 14:22:35 +02:00
2022-09-22 16:43:05 +02:00
2023-05-24 17:32:44 +01:00
2023-07-23 13:49:40 +02:00
2022-09-22 16:32:25 +02:00
2022-08-30 14:22:35 +02:00
2022-08-30 14:22:35 +02:00
2022-08-30 14:22:35 +02:00
2022-08-30 14:22:35 +02:00
2022-03-03 15:06:31 +01:00
2022-03-03 15:06:31 +01:00
2022-08-30 14:21:59 +02:00
2022-08-30 14:22:35 +02:00
2023-08-23 17:52:31 +02:00
2022-08-30 14:22:35 +02:00
2022-03-03 15:06:31 +01:00
2023-07-23 13:49:41 +02:00
2022-08-30 14:22:35 +02:00
2023-06-09 10:34:26 +02:00
2021-07-27 12:17:21 +02:00
2022-06-27 14:37:09 +02:00
2023-06-21 16:00:57 +02:00
2022-08-30 14:22:35 +02:00
2022-09-22 16:14:08 +02:00
2022-07-16 08:16:01 +02:00
2023-05-11 23:03:01 +09:00
2022-08-30 14:22:35 +02:00
2022-08-30 14:22:35 +02:00
2022-08-30 14:22:35 +02:00
2022-08-30 14:22:35 +02:00
2022-08-30 14:22:35 +02:00
2022-09-22 16:14:08 +02:00
2022-08-30 14:22:35 +02:00
2022-08-30 14:22:35 +02:00
2022-08-30 14:22:35 +02:00
2022-08-30 14:22:35 +02:00
2022-08-30 14:22:35 +02:00
2022-09-22 16:14:08 +02:00
2022-08-30 14:22:35 +02:00
2023-03-11 13:55:39 +01:00
2022-08-30 14:22:35 +02:00
2022-08-30 14:22:35 +02:00
2022-05-19 18:23:19 +02:00
2022-08-30 14:22:35 +02:00
2023-09-06 21:27:01 +01:00
2022-08-30 14:22:35 +02:00
2022-08-30 14:22:35 +02:00
2022-08-30 14:22:35 +02:00
2023-07-23 13:49:41 +02:00
2022-08-30 14:22:35 +02:00
2023-09-13 09:43:05 +02:00
2022-08-30 14:22:35 +02:00
2023-07-19 16:21:53 +02:00
2022-07-28 10:37:42 +02:00
2022-02-08 11:07:16 +01:00
2022-08-30 14:22:35 +02:00
2023-09-13 09:42:56 +02:00
2023-04-13 16:55:28 +02:00
2023-08-03 10:24:08 +02:00
2023-09-13 09:42:52 +02:00
2022-08-30 14:22:35 +02:00
2023-08-23 17:52:23 +02:00
2022-07-28 10:35:23 +02:00
2022-08-30 14:22:35 +02:00
2022-08-30 14:22:35 +02:00
2022-12-31 13:32:40 +01:00
2022-08-30 14:22:35 +02:00
2022-08-30 14:22:35 +02:00
2022-09-25 09:22:13 +02:00
2022-08-30 14:22:35 +02:00
2022-08-30 14:22:35 +02:00
2022-08-30 14:28:33 +02:00
2022-09-22 16:14:07 +02:00
2022-08-30 14:22:35 +02:00
2022-08-30 14:22:35 +02:00