mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-02 10:00:57 +02:00
Merge branch 'bugfix/es_idf_clkicg_idf-13119' into 'master'
fix(esp_hw_support): fix dead code and out-of-bounds in esp_sleep_clock_config function Closes IDF-13119 and IDF-13103 See merge request espressif/esp-idf!40989
This commit is contained in:
@@ -110,7 +110,8 @@ typedef enum {
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_SLEEP_CLOCK_OPTION_GATE, //!< Gate the clock in sleep mode
|
||||
ESP_SLEEP_CLOCK_OPTION_UNGATE //!< Ungate the clock in sleep mode
|
||||
ESP_SLEEP_CLOCK_OPTION_UNGATE, //!< Ungate the clock in sleep mode
|
||||
ESP_SLEEP_CLOCK_OPTION_MAX
|
||||
} esp_sleep_clock_option_t;
|
||||
|
||||
/**
|
||||
|
@@ -2540,7 +2540,7 @@ int32_t* esp_sleep_sub_mode_dump_config(FILE *stream) {
|
||||
#if SOC_PM_SUPPORT_PMU_CLK_ICG
|
||||
esp_err_t esp_sleep_clock_config(esp_sleep_clock_t clock, esp_sleep_clock_option_t option)
|
||||
{
|
||||
if (clock > ESP_SLEEP_CLOCK_MAX || option > ESP_SLEEP_CLOCK_OPTION_UNGATE) {
|
||||
if (clock >= ESP_SLEEP_CLOCK_MAX || option >= ESP_SLEEP_CLOCK_OPTION_MAX) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user