event_data.Event = NET_EVENT_WIFI_FORGET_AP_IND;
g_strlcpy(event_string, "Sending NET_EVENT_WIFI_FORGET_AP_IND", 64);
- _net_dbus_pending_call_unref();
-
event_data.Error = Error;
event_data.Datalength = 0;
event_data.Data = NULL;
WIFI_LOG(WIFI_ERROR, "Delete profile, error [%s]\n", error->message);
Error = NET_ERR_UNKNOWN;
g_error_free(error);
- _net_dbus_pending_call_unref();
- __NETWORK_FUNC_EXIT__;
- return;
+ goto error;
}
Error = NET_ERR_NO_PROFILE;
g_variant_get(message, "(a(oa{sv}))", &iter);
if (iter == NULL) {
g_variant_unref(message);
- _net_dbus_pending_call_unref();
- __NETWORK_FUNC_EXIT__;
- return;
+ goto error;
}
while (g_variant_iter_loop(iter, "(oa{sv})", &path, &service)) {
g_variant_iter_free(iter);
g_variant_unref(message);
+ if (Error != NET_ERR_NONE)
+ goto error;
+
g_strlcpy(wifi_prof_name.ProfileName,
request_table[NETWORK_REQUEST_TYPE_FORGET_AP].ProfileName,
NET_PROFILE_NAME_LEN_MAX + 1);
WIFI_LOG(WIFI_ERROR, //LCOV_EXCL_LINE
"Failed to delete service(profile). Error [%s]",
_net_print_error(Error));
-
- Error = NET_ERR_UNKNOWN; //LCOV_EXCL_LINE
- __NETWORK_FUNC_EXIT__; //LCOV_EXCL_LINE
+ goto error;
}
-
if (prof_info.ProfileState != NET_STATE_TYPE_ONLINE &&
- prof_info.ProfileState != NET_STATE_TYPE_READY)
+ prof_info.ProfileState != NET_STATE_TYPE_READY &&
+ prof_info.ProfileState != NET_STATE_TYPE_ASSOCIATION &&
+ prof_info.ProfileState != NET_STATE_TYPE_CONFIGURATION)
net_forget_ap_finshed(Error);
+ _net_dbus_pending_call_unref();
+ __NETWORK_FUNC_EXIT__;
+ return;
+
+error:
+ net_forget_ap_finshed(Error);
+ _net_dbus_pending_call_unref();
__NETWORK_FUNC_EXIT__;
}