Skip to content

Commit 4d01353

Browse files
nordic-piksnashif
authored andcommitted
drivers: serial: fix cfg.baudrate may be used uninitialized
drivers/serial/uart_async_to_irq.c: In function 'get_rx_timeout': drivers/serial/uart_async_to_irq.c:51:26: warning: 'cfg.baudrate' may be used uninitialized 51 | baudrate = cfg.baudrate; | ~~~~~~~~~^~~~~~~~~~~~~~ drivers/serial/uart_async_to_irq.c:45:28: note: 'cfg' declared here 45 | struct uart_config cfg; Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
1 parent 69fb606 commit 4d01353

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/serial/uart_async_to_irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static const struct uart_async_to_irq_config *get_config(const struct device *de
4242
/* Function calculates RX timeout based on baudrate. */
4343
static uint32_t get_rx_timeout(const struct device *dev)
4444
{
45-
struct uart_config cfg;
45+
struct uart_config cfg = { 0 };
4646
int err;
4747
uint32_t baudrate;
4848

0 commit comments

Comments
 (0)