Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7da4b8b7 authored by Peter Hurley's avatar Peter Hurley Committed by Greg Kroah-Hartman
Browse files

serial: core: Fix port mutex assert if lockdep disabled



commit 4047b371 ("serial: core: Prevent unsafe uart port access,
part 1") added lockdep assertion for port mutex but fails to check
if debug_locks has disabled lockdep (so lock state is no longer
reliable).

Use lockdep_assert_held() instead, which properly checks lockdep
state as well.

Reported-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Tested-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6550be9f
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -95,9 +95,7 @@ static inline void uart_port_deref(struct uart_port *uport)

static inline struct uart_port *uart_port_check(struct uart_state *state)
{
#ifdef CONFIG_LOCKDEP
	WARN_ON(!lockdep_is_held(&state->port.mutex));
#endif
	lockdep_assert_held(&state->port.mutex);
	return state->uart_port;
}