Skip to content

Commit 820d828

Browse files
nordic-krchnashif
authored andcommitted
drivers: serial: nrfx_uarte: Add missing check
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]>
1 parent 5d1c535 commit 820d828

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/serial/uart_nrfx_uarte.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,7 @@ static void uarte_nrfx_poll_out(const struct device *dev, unsigned char c)
11631163
key = irq_lock();
11641164
if (is_tx_ready(dev)) {
11651165
#if CONFIG_UART_ASYNC_API
1166-
if (data->async->tx_size &&
1166+
if (data->async && data->async->tx_size &&
11671167
data->async->tx_amount < 0) {
11681168
data->async->tx_amount =
11691169
nrf_uarte_tx_amount_get(uarte);

0 commit comments

Comments
 (0)