Fix Coverity issues 39/209739/1
authorJung Jihoon <jh8801.jung@samsung.com>
Wed, 10 Jul 2019 09:59:52 +0000 (18:59 +0900)
committersaerome kim <saerome.kim@samsung.com>
Wed, 10 Jul 2019 11:05:08 +0000 (20:05 +0900)
Dereference Null check : 1074421 1074417 1074423 1044429

Change-Id: Ibc19d8d80c54abd162bad520a7d06fbd94426957
Signed-off-by: Jung Jihoon <jh8801.jung@samsung.com>
src/wifi-networkmanager.c [changed mode: 0644->0755]
src/wifi-plugin.c [changed mode: 0644->0755]
src/wifi-scan.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 03fc674..14ced49
@@ -388,10 +388,8 @@ char* __nm_get_ip_address(void)
 
 void __nm_get_connected_bssid(char** connect_bssid)
 {
-       if (connect_bssid == NULL) {
-               *connect_bssid = NULL;
+       if (connect_bssid == NULL)
                return;
-       }
 
        *connect_bssid = g_strdup(connected_bssid);
        return;
old mode 100644 (file)
new mode 100755 (executable)
index 4d9ae2b..5a148ca
@@ -250,7 +250,7 @@ void __check_device_found(char* sbuf, char* ip_sbuf)
                        if (!(UAS_PRESENCE & wifi_detection_type))
                                break;
 
-                       if (!uas_cbs && !uas_cbs->device_detected_cb)
+                       if (!uas_cbs || !uas_cbs->device_detected_cb)
                                break;
 
                        /* Send PRESENCE callback */
old mode 100644 (file)
new mode 100755 (executable)
index db8f571..6a41448
@@ -247,7 +247,10 @@ gboolean __arp_packet_receive(GIOChannel *source, GIOCondition condition,
 
 gboolean __arp_packet_callback()
 {
-       if (arp_data && arp_data->is_arp_init)
+       if (arp_data == NULL)
+               return false;
+
+       if (arp_data->is_arp_init)
                clean_socket();
 
        if (arp_data->arp_mac_count <= 0)
@@ -496,7 +499,12 @@ int __start_arp(const char *ip, const char *mac)
 {
        int ret;
 
-       if (arp_data && arp_data->is_arp_init == 1) {
+       if (arp_data == NULL) {
+               UA_WIFI_ERR("arp_data is not initialized");
+               return UAS_STATUS_FAIL;
+       }
+
+       if (arp_data->is_arp_init == 1) {
                UA_WIFI_ERR("Already initialized");
                return UAS_STATUS_FAIL;
        }