@@ -303,7 +303,6 @@ static esp_err_t esp_rewrite_ota_data(esp_partition_subtype_t subtype)
303
303
uint16_t ota_app_count = 0 ;
304
304
uint32_t i = 0 ;
305
305
uint32_t seq ;
306
- const void * result = NULL ;
307
306
308
307
find_partition = esp_partition_find_first (ESP_PARTITION_TYPE_DATA , ESP_PARTITION_SUBTYPE_DATA_OTA , NULL );
309
308
if (find_partition != NULL ) {
@@ -327,6 +326,7 @@ static esp_err_t esp_rewrite_ota_data(esp_partition_subtype_t subtype)
327
326
return ESP_ERR_INVALID_ARG ;
328
327
}
329
328
#ifdef CONFIG_TARGET_PLATFORM_ESP32
329
+ const void * result = NULL ;
330
330
static spi_flash_mmap_memory_t ota_data_map ;
331
331
ret = esp_partition_mmap (find_partition , 0 , find_partition -> size , SPI_FLASH_MMAP_DATA , & result , & ota_data_map );
332
332
if (ret != ESP_OK ) {
@@ -343,13 +343,13 @@ static esp_err_t esp_rewrite_ota_data(esp_partition_subtype_t subtype)
343
343
ret = spi_flash_read (find_partition -> address , & s_ota_select [0 ], sizeof (ota_select ));
344
344
if (ret != ESP_OK ) {
345
345
ESP_LOGE (TAG , "read failed" );
346
- return NULL ;
346
+ return ret ;
347
347
}
348
348
349
349
ret = spi_flash_read (find_partition -> address + 0x1000 , & s_ota_select [1 ], sizeof (ota_select ));
350
350
if (ret != ESP_OK ) {
351
351
ESP_LOGE (TAG , "read failed" );
352
- return NULL ;
352
+ return ret ;
353
353
}
354
354
#endif
355
355
@@ -465,7 +465,6 @@ const esp_partition_t *esp_ota_get_boot_partition(void)
465
465
esp_err_t ret ;
466
466
const esp_partition_t * find_partition = NULL ;
467
467
468
- const void * result = NULL ;
469
468
uint16_t ota_app_count = 0 ;
470
469
find_partition = esp_partition_find_first (ESP_PARTITION_TYPE_DATA , ESP_PARTITION_SUBTYPE_DATA_OTA , NULL );
471
470
@@ -475,6 +474,7 @@ const esp_partition_t *esp_ota_get_boot_partition(void)
475
474
}
476
475
477
476
#ifdef CONFIG_TARGET_PLATFORM_ESP32
477
+ const void * result = NULL ;
478
478
static spi_flash_mmap_memory_t ota_data_map ;
479
479
ret = esp_partition_mmap (find_partition , 0 , find_partition -> size , SPI_FLASH_MMAP_DATA , & result , & ota_data_map );
480
480
if (ret != ESP_OK ) {
0 commit comments