Skip to content

Commit 1060c34

Browse files
file version checking handled after other errors. (#1641)
1 parent 9c6b876 commit 1060c34

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

source/6LoWPAN/Thread/thread_nvm_store.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,18 @@ int thread_nvm_store_mleid_rloc_map_read(thread_nvm_mleid_rloc_map *mleid_rloc_m
147147

148148
int ret = thread_nvm_store_read(lc_data_path, mleid_rloc_map, sizeof(thread_nvm_mleid_rloc_map), &version);
149149

150+
if (THREAD_NVM_FILE_SUCCESS!=ret) {
151+
tr_info("Leader data map read failed");
152+
thread_nvm_store_mleid_rloc_map_remove();
153+
return ret;
154+
}
155+
150156
if (LEADER_INFO_DATA_VERSION!=version) {
151157
tr_info("Leader data map version mismatch %"PRIu32, version);
152158
thread_nvm_store_mleid_rloc_map_remove();
153159
return THREAD_NVM_FILE_VERSION_WRONG;
154160
}
155-
if (THREAD_NVM_FILE_SUCCESS!=ret) {
156-
tr_info("Leader data map read failed");
157-
thread_nvm_store_mleid_rloc_map_remove();
158-
}
161+
159162
return ret;
160163
}
161164

0 commit comments

Comments
 (0)