Skip to content

Commit

Permalink
[nrf fromtree] drivers: serial: nrfx_uarte: Add missing check
Browse files Browse the repository at this point in the history
If statement was unconditionally reading a field from async struct
while pointer to this struct may be null if asynchronous API is
enabled but given driver instance is not using it.

Signed-off-by: Krzysztof Chruscinski <[email protected]>
  • Loading branch information
nordic-krch authored and tejlmand committed Feb 17, 2021
1 parent c90bc89 commit bf19820
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/serial/uart_nrfx_uarte.c
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ static void uarte_nrfx_poll_out(const struct device *dev, unsigned char c)
key = irq_lock();
if (is_tx_ready(dev)) {
#if CONFIG_UART_ASYNC_API
if (data->async->tx_size &&
if (data->async && data->async->tx_size &&
data->async->tx_amount < 0) {
data->async->tx_amount =
nrf_uarte_tx_amount_get(uarte);
Expand Down

0 comments on commit bf19820

Please sign in to comment.