@@ -121,15 +121,13 @@ int wifi_credentials_get_by_ssid_personal_struct(const char *ssid, size_t ssid_l
121
121
k_mutex_lock (& wifi_credentials_mutex , K_FOREVER );
122
122
123
123
idx = lookup_idx (ssid , ssid_len );
124
-
125
124
if (idx == -1 ) {
126
125
LOG_DBG ("Cannot retrieve WiFi credentials, no entry found for the provided SSID" );
127
126
ret = - ENOENT ;
128
127
goto exit ;
129
128
}
130
129
131
130
ret = wifi_credentials_load_entry (idx , buf , sizeof (struct wifi_credentials_personal ));
132
-
133
131
if (ret ) {
134
132
LOG_ERR ("Failed to load WiFi credentials at index %d, err: %d" , idx , ret );
135
133
goto exit ;
@@ -169,7 +167,6 @@ int wifi_credentials_set_personal_struct(const struct wifi_credentials_personal
169
167
k_mutex_lock (& wifi_credentials_mutex , K_FOREVER );
170
168
171
169
idx = lookup_idx (creds -> header .ssid , creds -> header .ssid_len );
172
-
173
170
if (idx == -1 ) {
174
171
idx = lookup_unused_idx ();
175
172
if (idx == -1 ) {
@@ -180,7 +177,6 @@ int wifi_credentials_set_personal_struct(const struct wifi_credentials_personal
180
177
}
181
178
182
179
ret = wifi_credentials_store_entry (idx , creds , sizeof (struct wifi_credentials_personal ));
183
-
184
180
if (ret ) {
185
181
LOG_ERR ("Failed to store WiFi credentials at index %d, err: %d" , idx , ret );
186
182
goto exit ;
@@ -340,15 +336,14 @@ int wifi_credentials_delete_by_ssid(const char *ssid, size_t ssid_len)
340
336
}
341
337
342
338
k_mutex_lock (& wifi_credentials_mutex , K_FOREVER );
343
- idx = lookup_idx (ssid , ssid_len );
344
339
340
+ idx = lookup_idx (ssid , ssid_len );
345
341
if (idx == -1 ) {
346
342
LOG_DBG ("WiFi credentials entry was not found" );
347
343
goto exit ;
348
344
}
349
345
350
346
ret = wifi_credentials_delete_entry (idx );
351
-
352
347
if (ret ) {
353
348
LOG_ERR ("Failed to delete WiFi credentials index %d, err: %d" , idx , ret );
354
349
goto exit ;
0 commit comments