From 2ee22f968a509335d57d8ea243d14baf2ab04bbd Mon Sep 17 00:00:00 2001 From: "harshal.patil" Date: Fri, 6 Dec 2024 15:55:20 +0530 Subject: [PATCH] fix(nvs_flash): Allow matching with partition when label provided is NULL - When esp_parition_find_first() is called with the partition label provided as NULL by the bootloader, allowing matching to the first partition that matches partition_type and partition_subtype as done in the app variant. --- components/esp_partition/partition_bootloader.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/esp_partition/partition_bootloader.c b/components/esp_partition/partition_bootloader.c index 8cfc5ff48b..5f01ddd705 100644 --- a/components/esp_partition/partition_bootloader.c +++ b/components/esp_partition/partition_bootloader.c @@ -46,9 +46,9 @@ const esp_partition_t* esp_partition_find_first(esp_partition_type_t type, esp_p // if everything matches, populate the internal_partition if (partition->type == type - && partition->subtype == subtype - && strncmp((char*) partition->label, label, sizeof(partition->label) - 1) == 0) { - + && partition->subtype == subtype + && (!label || (label && (strncmp((char*) partition->label, label, sizeof(partition->label) - 1) == 0))) + ) { ESP_LOGV(TAG, "Matched", partition->type, partition->subtype, partition->label); internal_partition.flash_chip = NULL; //esp_flash_default_chip; internal_partition.type = partition->type;