Fixed svace issues 85/88985/1 accepted/tizen/common/20160921.162916 accepted/tizen/ivi/20160922.042155 accepted/tizen/mobile/20160922.042258 accepted/tizen/tv/20160922.042105 accepted/tizen/wearable/20160922.042144 submit/tizen/20160921.092833
authorchleun.moon <chleun.moon@samsung.com>
Wed, 21 Sep 2016 09:23:40 +0000 (18:23 +0900)
committerchleun.moon <chleun.moon@samsung.com>
Wed, 21 Sep 2016 09:23:50 +0000 (18:23 +0900)
Change-Id: I38202eba8e22d3b1806bbd6b3647111b9df1f038
Signed-off-by: cheoleun <chleun.moon@samsung.com>
plugin/wpasupplicant/ctrl_iface_sock/wfd-plugin-wpasupplicant.c

index 77394ef..58f9361 100644 (file)
@@ -2224,22 +2224,22 @@ static gboolean ws_event_handler(GIOChannel *source,
        switch (event.event_id) {
        case WS_EVENT_DEVICE_FOUND:
                event.event_id = WFD_OEM_EVENT_PEER_FOUND;
-               if (!g_pd && !g_pd->callback && !g_pd->callback->peer_found_cb)
+               if (g_pd && g_pd->callback && g_pd->callback->peer_found_cb)
                        g_pd->callback->peer_found_cb(&event);
                break;
        case WS_EVENT_DEVICE_LOST:
                event.event_id = WFD_OEM_EVENT_PEER_DISAPPEARED;
-               if (!g_pd && !g_pd->callback && !g_pd->callback->peer_disappeared_cb)
+               if (g_pd && g_pd->callback && g_pd->callback->peer_disappeared_cb)
                        g_pd->callback->peer_disappeared_cb(&event);
                break;
        case WS_EVENT_FIND_STOPED:
                event.event_id = WFD_OEM_EVENT_DISCOVERY_FINISHED;
-               if (!g_pd && !g_pd->callback && !g_pd->callback->discovery_finished_cb)
+               if (g_pd && g_pd->callback && g_pd->callback->discovery_finished_cb)
                        g_pd->callback->discovery_finished_cb(&event);
                break;
        case WS_EVENT_PROV_DISC_PBC_REQ:
                event.event_id = WFD_OEM_EVENT_PROV_DISC_REQ;
-               if (!g_pd && !g_pd->callback && !g_pd->callback->prov_disc_req_cb)
+               if (g_pd && g_pd->callback && g_pd->callback->prov_disc_req_cb)
                        g_pd->callback->prov_disc_req_cb(&event);
                break;
        case WS_EVENT_PROV_DISC_PBC_RESP:
@@ -2250,7 +2250,7 @@ static gboolean ws_event_handler(GIOChannel *source,
                        WDP_LOGE("Invalid peer mac address[" MACSTR "]", MAC2STR(event.dev_addr));
                        goto done;
                }
-               if (!g_pd && !g_pd->callback && !g_pd->callback->prov_disc_resp_cb)
+               if (g_pd && g_pd->callback && g_pd->callback->prov_disc_resp_cb)
                        g_pd->callback->prov_disc_resp_cb(&event);
                break;
        case WS_EVENT_PROV_DISC_SHOW_PIN:
@@ -2259,12 +2259,12 @@ static gboolean ws_event_handler(GIOChannel *source,
                        event.event_id = WFD_OEM_EVENT_PROV_DISC_RESP;
                        memset(g_pd_out, 0x0, OEM_MACADDR_LEN);
                        WDP_LOGD("Peer mac address verified");
-                       if (!g_pd && !g_pd->callback && !g_pd->callback->prov_disc_resp_cb)
+                       if (g_pd && g_pd->callback && g_pd->callback->prov_disc_resp_cb)
                                g_pd->callback->prov_disc_resp_cb(&event);
                } else if (!memcmp(g_pd_out, null_mac, OEM_MACADDR_LEN)) {
                        event.event_id = WFD_OEM_EVENT_PROV_DISC_REQ;
                        WDP_LOGD("      PD request from peer[" MACSTR "]", MAC2STR(event.dev_addr));
-                       if (!g_pd && !g_pd->callback && !g_pd->callback->prov_disc_req_cb)
+                       if (g_pd && g_pd->callback && g_pd->callback->prov_disc_req_cb)
                                g_pd->callback->prov_disc_req_cb(&event);
                } else {
                        WDP_LOGE("Invalid peer mac address[" MACSTR "]", MAC2STR(event.dev_addr));
@@ -2278,32 +2278,32 @@ static gboolean ws_event_handler(GIOChannel *source,
                        memset(g_pd_out, 0x0, OEM_MACADDR_LEN);
                        WDP_LOGD("Peer mac address verified, but PD failed");
                }
-               if (!g_pd && !g_pd->callback && !g_pd->callback->prov_disc_fail_cb)
+               if (g_pd && g_pd->callback && g_pd->callback->prov_disc_fail_cb)
                        g_pd->callback->prov_disc_fail_cb(&event);
                break;
        case WS_EVENT_GO_NEG_REQUEST:
                event.event_id = WFD_OEM_EVENT_GO_NEG_REQ;
-               if (!g_pd && !g_pd->callback && !g_pd->callback->go_neg_req_cb)
+               if (g_pd && g_pd->callback && g_pd->callback->go_neg_req_cb)
                        g_pd->callback->go_neg_req_cb(&event);
                break;
        case WS_EVENT_GO_NEG_FAILURE:
                event.event_id = WFD_OEM_EVENT_GO_NEG_FAIL;
-               if (!g_pd && !g_pd->callback && !g_pd->callback->go_neg_fail_cb)
+               if (g_pd && g_pd->callback && g_pd->callback->go_neg_fail_cb)
                        g_pd->callback->go_neg_fail_cb(&event);
                break;
        case WS_EVENT_GO_NEG_SUCCESS:
                event.event_id = WFD_OEM_EVENT_GO_NEG_DONE;
-               if (!g_pd && !g_pd->callback && !g_pd->callback->go_neg_done_cb)
+               if (g_pd && g_pd->callback && g_pd->callback->go_neg_done_cb)
                        g_pd->callback->go_neg_done_cb(&event);
                break;
        case WS_EVENT_WPS_FAIL:
                event.event_id = WFD_OEM_EVENT_WPS_FAIL;
-               if (!g_pd && !g_pd->callback && !g_pd->callback->wps_fail_cb)
+               if (g_pd && g_pd->callback && g_pd->callback->wps_fail_cb)
                        g_pd->callback->wps_fail_cb(&event);
                break;
        case WS_EVENT_GROUP_FORMATION_FAILURE:
                event.event_id = WFD_OEM_EVENT_WPS_FAIL;
-               if (!g_pd && !g_pd->callback && !g_pd->callback->group_formation_failure_cb)
+               if (g_pd && g_pd->callback && g_pd->callback->group_formation_failure_cb)
                        g_pd->callback->group_formation_failure_cb(&event);
                break;
        case WS_EVENT_WPS_SUCCESS:
@@ -2311,12 +2311,12 @@ static gboolean ws_event_handler(GIOChannel *source,
        case WS_EVENT_GROUP_FORMATION_SUCCESS:
                event.event_id = WFD_OEM_EVENT_WPS_DONE;
                /* TODO: connect to supplicant via group interface */
-               if (!g_pd && !g_pd->callback && !g_pd->callback->wps_done_cb)
+               if (g_pd && g_pd->callback && g_pd->callback->wps_done_cb)
                        g_pd->callback->wps_done_cb(&event);
                break;
        case WS_EVENT_STA_CONNECTED:
                event.event_id = WFD_OEM_EVENT_STA_CONNECTED;
-               if (!g_pd && !g_pd->callback && !g_pd->callback->sta_connected_cb)
+               if (g_pd && g_pd->callback && g_pd->callback->sta_connected_cb)
                        g_pd->callback->sta_connected_cb(&event);
                break;
        case WS_EVENT_GROUP_STARTED:
@@ -2331,7 +2331,7 @@ static gboolean ws_event_handler(GIOChannel *source,
                                /* goto done; */
                        }
                }
-               if (!g_pd && !g_pd->callback && !g_pd->callback->group_created_cb)
+               if (g_pd && g_pd->callback && g_pd->callback->group_created_cb)
                        g_pd->callback->group_created_cb(&event);
                break;
        case WS_EVENT_GROUP_REMOVED:
@@ -2351,33 +2351,33 @@ static gboolean ws_event_handler(GIOChannel *source,
                                _ws_flush();
                        }
                }
-               if (!g_pd && !g_pd->callback && !g_pd->callback->group_destroyed_cb)
+               if (g_pd && g_pd->callback && g_pd->callback->group_destroyed_cb)
                        g_pd->callback->group_destroyed_cb(&event);
                break;
        case WS_EVENT_INVITATION_RECEIVED:
                event.event_id = WFD_OEM_EVENT_INVITATION_REQ;
-               if (!g_pd && !g_pd->callback && !g_pd->callback->invitation_req_cb)
+               if (g_pd && g_pd->callback && g_pd->callback->invitation_req_cb)
                        g_pd->callback->invitation_req_cb(&event);
                break;
        case WS_EVENT_INVITATION_RESULT:
                event.event_id = WFD_OEM_EVENT_INVITATION_RES;
-               if (!g_pd && !g_pd->callback && !g_pd->callback->invitation_resp_cb)
+               if (g_pd && g_pd->callback && g_pd->callback->invitation_resp_cb)
                        g_pd->callback->invitation_resp_cb(&event);
                break;
        case WS_EVENT_STA_DISCONNECTED:
                event.event_id = WFD_OEM_EVENT_STA_DISCONNECTED;
-               if (!g_pd && !g_pd->callback && !g_pd->callback->sta_disconnected_cb)
+               if (g_pd && g_pd->callback && g_pd->callback->sta_disconnected_cb)
                        g_pd->callback->sta_disconnected_cb(&event);
                break;
        case WS_EVENT_TERMINATING:
                event.event_id = WFD_OEM_EVENT_DEACTIVATED;
-               if (!g_pd && !g_pd->callback && !g_pd->callback->deactivated_cb)
+               if (g_pd && g_pd->callback && g_pd->callback->deactivated_cb)
                        g_pd->callback->deactivated_cb(&event);
                break;
 #ifdef TIZEN_FEATURE_SERVICE_DISCOVERY
        case WS_EVENT_SERV_DISC_RESP:
                event.event_id = WFD_OEM_EVENT_SERV_DISC_RESP;
-               if (!g_pd && !g_pd->callback && !g_pd->callback->serv_disc_resp_cb)
+               if (g_pd && g_pd->callback && g_pd->callback->serv_disc_resp_cb)
                        g_pd->callback->serv_disc_resp_cb(&event);
                break;
 #endif /* TIZEN_FEATURE_SERVICE_DISCOVERY */