mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
components/nvs: fix infinite loop when loading namespaces
This commit is contained in:
parent
f04c894123
commit
35d50643bc
@ -44,6 +44,7 @@ esp_err_t Storage::init(uint32_t baseSector, uint32_t sectorCount)
|
||||
return err;
|
||||
}
|
||||
|
||||
// load namespaces list
|
||||
clearNamespaces();
|
||||
std::fill_n(mNamespaceUsage.data(), mNamespaceUsage.byteSize() / 4, 0);
|
||||
for (auto it = mPageManager.begin(); it != mPageManager.end(); ++it) {
|
||||
@ -56,6 +57,7 @@ esp_err_t Storage::init(uint32_t baseSector, uint32_t sectorCount)
|
||||
item.getValue(entry->mIndex);
|
||||
mNamespaces.push_back(entry);
|
||||
mNamespaceUsage.set(entry->mIndex, true);
|
||||
itemIndex += item.span;
|
||||
}
|
||||
}
|
||||
mNamespaceUsage.set(0, true);
|
||||
|
Loading…
Reference in New Issue
Block a user