Skip to content

Commit d30bdd5

Browse files
authored
[Infineon] Fix the Network information does not restore back if failsafe is set to 0 (#22473)
* Check value size before cleaning config value.
1 parent c6cde56 commit d30bdd5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/platform/Infineon/CYW30739/KeyValueStoreManagerImpl.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,11 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Delete(const char * key)
149149
err = CYW30739Config::ClearConfigValue(entry->GetKeyConfigKey());
150150
VerifyOrExit(ChipError::IsSuccess(err), err = CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND);
151151

152-
err = CYW30739Config::ClearConfigValue(entry->GetValueConfigKey());
153-
VerifyOrExit(ChipError::IsSuccess(err), err = CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND);
152+
if (entry->GetValueSize() != 0)
153+
{
154+
err = CYW30739Config::ClearConfigValue(entry->GetValueConfigKey());
155+
VerifyOrExit(ChipError::IsSuccess(err), err = CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND);
156+
}
154157

155158
slist_del(entry, &mKeyConfigIdList);
156159
Platform::Delete(entry);

0 commit comments

Comments
 (0)