Fix svace issues 62/314462/3 accepted/tizen_unified accepted/tizen_unified_dev accepted/tizen_unified_x tizen accepted/tizen/unified/20240723.034801 accepted/tizen/unified/dev/20240724.110019 accepted/tizen/unified/x/20240723.090015
authorSeonah Moon <seonah1.moon@samsung.com>
Fri, 12 Jul 2024 04:43:00 +0000 (13:43 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Fri, 12 Jul 2024 05:08:13 +0000 (14:08 +0900)
- UNREACHABLE_CODE.RET

Change-Id: I0313e4ba1e6a1541ce6d902e28c0cf30fd09c38a

packaging/mobileap-agent.spec
src/mobileap.c
src/mobileap_bluetooth.c
src/mobileap_softap.c
src/mobileap_usb.c
src/mobileap_wifi.c

index ef46b12..d39f38c 100644 (file)
@@ -1,6 +1,6 @@
 Name: mobileap-agent
 Summary: Mobile AP daemon for setting tethering environments
-Version: 1.1.3
+Version: 1.1.4
 Release: 1
 Group: System/Network
 License: Apache-2.0
index 990a0bc..d64408b 100755 (executable)
@@ -733,7 +733,7 @@ int mobileap_main(void)
        if (mobileap_state == VCONFKEY_MOBILE_HOTSPOT_MODE_WIFI_AP) {
                DBG("Start SoftAP State recovery");
                ret = softap_start_recovery();
-               if (ret < 0) {
+               if (ret == false) {
                        ERR("softap is not recovered");
                        return 0;
                }
index 092f18f..d559d1b 100755 (executable)
@@ -625,13 +625,9 @@ gboolean tethering_enable_bt_tethering(Tethering *obj,
        }
 
 #ifdef TIZEN_FEATURE_ENABLE_IPV6
-       if (address_type == MOBILE_AP_ADDRESS_TYPE_IPV6) {
-               if (!_mobileap_set_ipv6_state(MOBILE_AP_STATE_BT)) {
-                       ret = MOBILE_AP_ERROR_RESOURCE;
-                       __deinit_bt();
-                       goto DONE;
-               }
-       }
+       if (address_type == MOBILE_AP_ADDRESS_TYPE_IPV6)
+               _mobileap_set_ipv6_state(MOBILE_AP_STATE_BT);
+
 #endif
 
        if (__is_bt_adapter_on() == FALSE) {
index 3b7f54c..e49c986 100755 (executable)
@@ -388,7 +388,7 @@ static int __execute_hostapd_wps(const mobile_ap_type_e type, softap_settings_t
 //LCOV_EXCL_STOP
 #endif
 
-static int __terminate_hostapd()
+static void __terminate_hostapd()
 {
        DBG("+\n");
 
@@ -399,7 +399,7 @@ static int __terminate_hostapd()
        DBG("terminatin band: %d ", wifi_band);
        if (hostapd_pid[wifi_band] == 0) {
                ERR("There is no hostapd\n"); //LCOV_EXCL_LINE
-               return MOBILE_AP_ERROR_NONE;
+               return;
        }
 
        kill(hostapd_pid[wifi_band], SIGTERM);
@@ -409,8 +409,6 @@ static int __terminate_hostapd()
        ret = unlink(hostapd_get_conf_file());
        if (ret < 0)
                ERR("unlink is failed : %s\n", strerror_r(errno, buf, sizeof(buf))); //LCOV_EXCL_LINE
-
-       return MOBILE_AP_ERROR_NONE;
 }
 
 /*
@@ -1175,9 +1173,7 @@ int _mh_core_disable_softap(char *if_name)
                if (ret_status != MOBILE_AP_ERROR_NONE)
                        ERR("hostapd termination is failed\n"); //LCOV_EXCL_LINE
 
-               ret_status = __terminate_hostapd();
-               if (ret_status != MOBILE_AP_ERROR_NONE)
-                       ERR("hostapd termination is failed\n"); //LCOV_EXCL_LINE
+               __terminate_hostapd();
                break;
 
        default:
index 4c1b2ae..fae0396 100755 (executable)
@@ -473,9 +473,7 @@ mobile_ap_error_code_e _disable_usb_tethering(Tethering *obj, mobile_ap_address_
 #endif
 
        _deinit_tethering(address_type);
-
-       if (_remove_station_info_all(MOBILE_AP_TYPE_USB) != MOBILE_AP_ERROR_NONE)
-               ERR("_remove_station_info_all is failed. Ignore it\n"); //LCOV_EXCL_LINE
+       _remove_station_info_all(MOBILE_AP_TYPE_USB);
 
        /* Clear DBus Signal Handler for USB Client State */
        if (conn) {
index 1181ba5..0aae1cb 100755 (executable)
@@ -877,9 +877,7 @@ mobile_ap_error_code_e _disable_wifi_tethering(Tethering *obj, mobile_ap_address
        _flush_ip_address(src_if);
        _deinit_timeout_cb(type);
 
-       if (_remove_station_info_all(type) != MOBILE_AP_ERROR_NONE)
-               ERR("_remove_station_info_all is failed. Ignore it.\n"); //LCOV_EXCL_LINE
-
+       _remove_station_info_all(type);
        ret = _mh_core_disable_softap(src_if);
        if (ret != MOBILE_AP_ERROR_NONE) {
                ERR("_mh_core_disable_softap is failed : %d\n", ret); //LCOV_EXCL_LINE
@@ -1042,8 +1040,7 @@ mobile_ap_error_code_e _disable_soft_ap(Softap *obj)
        _del_interface_routing(src_if, IP_ADDRESS_SOFTAP);
        _flush_ip_address(src_if);
        _deinit_timeout_cb(type);
-       if (_remove_station_info_all(type) != MOBILE_AP_ERROR_NONE)
-               ERR("_remove_station_info_all is failed. Ignore it.\n"); //LCOV_EXCL_LINE
+       _remove_station_info_all(type);
 
        ret = _mh_core_disable_softap(src_if);
        if (ret != MOBILE_AP_ERROR_NONE) {