Merge branch 'bugfix/esp-partition-erase-size-zero-check' into 'master'

fix(esp_partition): guard linux erase_range against zero erase_size

Closes IDF-6143

See merge request espressif/esp-idf!51681
This commit is contained in:
Martin Vychodil
2026-08-21 15:26:51 +08:00
@@ -648,6 +648,9 @@ esp_err_t esp_partition_write_raw(const esp_partition_t *partition, size_t dst_o
esp_err_t esp_partition_erase_range(const esp_partition_t *partition, size_t offset, size_t size)
{
assert(partition != NULL && s_spiflash_mem_file_buf != NULL);
if (partition->erase_size == 0) {
return ESP_ERR_INVALID_ARG;
}
if (partition->readonly) {
return ESP_ERR_NOT_ALLOWED;