- for (list = interface_list; list; list = list->next) {
- const char *interface_name = list->data;
- g_strlcpy(profile_info->ProfileName, interface_name, NET_PROFILE_NAME_LEN_MAX);
- g_strlcpy(profile_info->ProfileInfo.Wlan.net_info.ProfileName,
- interface_name, NET_PROFILE_NAME_LEN_MAX);
- break;
- }
-
- if (list == NULL) {
- CONNECTION_LOG(CONNECTION_ERROR, "Fail to get interface name");
- g_slist_free_full(interface_list, g_free);
- return CONNECTION_ERROR_INVALID_OPERATION;
- }
+ interface_name = interface_list->data;
+ g_strlcpy(profile_info->ProfileName, interface_name, NET_PROFILE_NAME_LEN_MAX);
+ g_strlcpy(profile_info->ProfileInfo.Wlan.net_info.ProfileName,
+ interface_name, NET_PROFILE_NAME_LEN_MAX);