@@ -121,15 +121,13 @@ int wifi_credentials_get_by_ssid_personal_struct(const char *ssid, size_t ssid_l
121121 k_mutex_lock (& wifi_credentials_mutex , K_FOREVER );
122122
123123 idx = lookup_idx (ssid , ssid_len );
124-
125124 if (idx == -1 ) {
126125 LOG_DBG ("Cannot retrieve WiFi credentials, no entry found for the provided SSID" );
127126 ret = - ENOENT ;
128127 goto exit ;
129128 }
130129
131130 ret = wifi_credentials_load_entry (idx , buf , sizeof (struct wifi_credentials_personal ));
132-
133131 if (ret ) {
134132 LOG_ERR ("Failed to load WiFi credentials at index %d, err: %d" , idx , ret );
135133 goto exit ;
@@ -169,7 +167,6 @@ int wifi_credentials_set_personal_struct(const struct wifi_credentials_personal
169167 k_mutex_lock (& wifi_credentials_mutex , K_FOREVER );
170168
171169 idx = lookup_idx (creds -> header .ssid , creds -> header .ssid_len );
172-
173170 if (idx == -1 ) {
174171 idx = lookup_unused_idx ();
175172 if (idx == -1 ) {
@@ -180,7 +177,6 @@ int wifi_credentials_set_personal_struct(const struct wifi_credentials_personal
180177 }
181178
182179 ret = wifi_credentials_store_entry (idx , creds , sizeof (struct wifi_credentials_personal ));
183-
184180 if (ret ) {
185181 LOG_ERR ("Failed to store WiFi credentials at index %d, err: %d" , idx , ret );
186182 goto exit ;
@@ -340,15 +336,14 @@ int wifi_credentials_delete_by_ssid(const char *ssid, size_t ssid_len)
340336 }
341337
342338 k_mutex_lock (& wifi_credentials_mutex , K_FOREVER );
343- idx = lookup_idx (ssid , ssid_len );
344339
340+ idx = lookup_idx (ssid , ssid_len );
345341 if (idx == -1 ) {
346342 LOG_DBG ("WiFi credentials entry was not found" );
347343 goto exit ;
348344 }
349345
350346 ret = wifi_credentials_delete_entry (idx );
351-
352347 if (ret ) {
353348 LOG_ERR ("Failed to delete WiFi credentials index %d, err: %d" , idx , ret );
354349 goto exit ;
0 commit comments