Fix svace issues 60/261260/1 accepted/tizen/unified/20210715.053928 submit/tizen/20210714.100702
authorSeonah Moon <seonah1.moon@samsung.com>
Wed, 14 Jul 2021 05:18:44 +0000 (14:18 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Wed, 14 Jul 2021 05:18:48 +0000 (14:18 +0900)
Change-Id: I3ba728610e840d98d1b9ed50864589708c37c105

plugins/ble-gatt/ble-gatt-plugin.cpp

index 09f5792..56802c4 100755 (executable)
@@ -395,7 +395,8 @@ static void __handle_disconnected_client(vine_gatt_s *gatt, const char *address)
 {
        RET_IF(gatt == NULL, "Invalid parameter.");
        RET_IF(address == NULL, "Invalid parameter.");
-       RET_IF(gatt->role.server == NULL || gatt->role.server->client_list, "Invalid parameter.");
+       RET_IF(gatt->role.server == NULL
+                       || gatt->role.server->client_list == NULL, "Invalid parameter.");
 
        vine_gatt_s *client_gatt = __find_client_gatt(gatt, address);
        RET_IF(client_gatt == NULL, "Cannot find a client[%s].", address);
@@ -632,7 +633,7 @@ int gatt_open(vine_dp_plugin_h handle, int addr_family,
        }
 
        descriptor = _add_gatt_descriptor(characteristic);
-       if (!characteristic) {
+       if (!descriptor) {
                VINE_LOGE("Failed to add descriptor.");
                goto ERR;
        }
@@ -782,7 +783,7 @@ int gatt_close(vine_dp_plugin_h handle)
        RET_VAL_IF(handle == NULL, VINE_DATA_PATH_ERROR_INVALID_PARAMETER, "handle is NULL");
 
        vine_gatt_s *gatt = (vine_gatt_s *)handle;
-       int ret;
+       int ret = BT_ERROR_NONE;
 
        if (gatt->type == VINE_GATT_ROLE_SERVER && gatt->role.server) {
                ret = bt_gatt_server_unregister_service(gatt->role.server->server, gatt->service);