From f40e50ee68161349dd3156d5243086bd5511a5a5 Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Wed, 8 Apr 2026 13:27:30 +0200 Subject: [PATCH] fix(lp_core): fix LP UART init parameter validation Align data_bits, flow_ctrl, and rx_flow_ctrl_thresh checks with uart_param_config(). Made-with: Cursor --- components/ulp/lp_core/lp_core_uart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/ulp/lp_core/lp_core_uart.c b/components/ulp/lp_core/lp_core_uart.c index 7a9d3ade87b..c702a6b06b8 100644 --- a/components/ulp/lp_core/lp_core_uart.c +++ b/components/ulp/lp_core/lp_core_uart.c @@ -34,9 +34,9 @@ static esp_err_t lp_core_uart_param_config(const lp_core_uart_cfg_t *cfg) esp_err_t ret = ESP_OK; /* Argument sanity check */ - if ((cfg->uart_proto_cfg.rx_flow_ctrl_thresh > SOC_LP_UART_FIFO_LEN) || - (cfg->uart_proto_cfg.flow_ctrl > UART_HW_FLOWCTRL_MAX) || - (cfg->uart_proto_cfg.data_bits > UART_DATA_BITS_MAX)) { + if ((cfg->uart_proto_cfg.rx_flow_ctrl_thresh >= SOC_LP_UART_FIFO_LEN) || + (cfg->uart_proto_cfg.flow_ctrl >= UART_HW_FLOWCTRL_MAX) || + (cfg->uart_proto_cfg.data_bits >= UART_DATA_BITS_MAX)) { // Invalid config return ESP_ERR_INVALID_ARG; }