Skip to content
Commit a05c88da authored by Christopher Friedt's avatar Christopher Friedt Committed by Carles Cufi
Browse files

drivers: console: uart_console: avoid infinite loop in isr



Previously, the `uart_console_isr()` routine assumed that the
return value of several uart API functions would only ever
return the equivalent of a boolean value. In fact, an integer
is returned on occasion, and that integer can take on many
values.

Since unary operations would either go to "true" or "false"
and since any non-zero integer evaluates to "true", even a
return value of something like `-ENODEV` would evalueate
to true.

Explicitly compare against the integer-equivalent value of
the expected boolean output.

With this, in the case of errors, negative return values do
not evaluate to "true", and the infinite loop is avoied.

Signed-off-by: default avatarChristopher Friedt <cfriedt@meta.com>
parent fef887a7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment