Fix SVACE issues in bluetooth-frwk 38/115038/1 accepted/tizen/3.0/common/20170220.125627 accepted/tizen/3.0/ivi/20170220.013431 accepted/tizen/3.0/mobile/20170220.013211 accepted/tizen/3.0/tv/20170220.013250 accepted/tizen/3.0/wearable/20170220.013345 submit/tizen_3.0/20170216.103037
authorAtul Rai <a.rai@samsung.com>
Thu, 16 Feb 2017 06:40:35 +0000 (12:10 +0530)
committerAtul Rai <a.rai@samsung.com>
Thu, 16 Feb 2017 06:40:35 +0000 (12:10 +0530)
SVACE Id: 174996, 174997, 175001, 175403, 175404, 175405, 175408.

Change-Id: I9585ca2777edd2caa8e626cb64834088d5304e82
Signed-off-by: Atul Rai <a.rai@samsung.com>
bt-api/bt-event-handler.c
bt-service/bt-service-tds.c

index 8290950..6395adb 100644 (file)
@@ -2936,8 +2936,7 @@ static void __bt_tds_event_filter(GDBusConnection *connection,
 
                if (data_len == 0) {
                        BT_ERR("No data");
-                       if (var)
-                               g_variant_unref(var);
+                       g_variant_unref(var);
                        return;
                }
 
@@ -2956,8 +2955,7 @@ static void __bt_tds_event_filter(GDBusConnection *connection,
                        g_free(info->data);
                        g_free(info);
                }
-               if (var)
-                       g_variant_unref(var);
+               g_variant_unref(var);
        } else if (strcasecmp(signal_name, BT_TDS_ACTIVATION_RESULT) == 0) {
                BT_DBG("TDS Control point Activation result");
                const char *address = NULL;
@@ -2995,8 +2993,7 @@ static void __bt_tds_event_filter(GDBusConnection *connection,
                _bt_common_event_cb(BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION,
                                BLUETOOTH_ERROR_NONE,  &ind_res,
                                event_info->cb, event_info->user_data);
-               if (byte_var)
-                       g_variant_unref(byte_var);
+               g_variant_unref(byte_var);
        } else if (strcasecmp(signal_name, BT_TDS_CONTROL_POINT_ENABLED) == 0) {
                BT_DBG("TDS Control point Enabled event");
                const char *address = NULL;
index 5ae0880..0bc83aa 100644 (file)
@@ -398,7 +398,7 @@ static void __bt_tds_set_scan_resp_data(bt_tds_provider_t *provider)
  * tds block in single adv pkt. So for each supported orgId, add only 1 tds blocks with
  * incomplte tds flag bit set, in adv data.
  */
-static int __bt_tds_provider_get_tds_adv_data(bt_tds_provider_t *provider, guint8 *adv_data)
+static int __bt_tds_provider_get_tds_adv_data(guint8 *adv_data)
 {
        GSList *l;
        GSList *l1;
@@ -406,7 +406,6 @@ static int __bt_tds_provider_get_tds_adv_data(bt_tds_provider_t *provider, guint
        unsigned int max_adv_len = BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX - BT_ADV_FLAG_LEN;
        int transport;
 
-       retv_if(NULL == provider, -1);
        retv_if(NULL == adv_data, -1);
 
        adv_data[1] = 0x26;
@@ -524,7 +523,7 @@ static int __bt_tds_set_advertising(bt_tds_provider_t *provider)
                        return BLUETOOTH_ERROR_NONE;
 
                /* Get updated TDS advertising data */
-               length = __bt_tds_provider_get_tds_adv_data(provider, adv.data);
+               length = __bt_tds_provider_get_tds_adv_data(adv.data);
                if (0 == length)
                        BT_INFO("No adv data found, return");
        }
@@ -888,9 +887,9 @@ int _bt_tds_provider_transport_remove(const char *sender, unsigned int tds_handl
         * advertising will be enabled again with updated advertising data.
         */
        if (_bt_is_multi_adv_supported())
-               __bt_tds_disable_advertising(provider);
+               ret = __bt_tds_disable_advertising(provider);
        else
-               __bt_tds_disable_advertising(NULL);
+               ret = __bt_tds_disable_advertising(NULL);
        if (ret != BLUETOOTH_ERROR_NONE) {
                BT_ERR("Failed to enable advertising with error: %d", ret);
                return ret;
@@ -1020,7 +1019,7 @@ static int __bt_tds_send_activation_response(char *address,
        int i;
 
        retv_if(NULL == address, BLUETOOTH_ERROR_INVALID_PARAM);
-       retv_if(0 > len && NULL == data, BLUETOOTH_ERROR_INVALID_PARAM);
+       retv_if(len > 0 && NULL == data, BLUETOOTH_ERROR_INVALID_PARAM);
 
        BT_DBG("+");
        conn = _bt_gdbus_get_system_gconn();
@@ -1075,7 +1074,7 @@ int _bt_tds_provider_send_activation_response(char *sender, unsigned int tds_han
 
        retv_if(NULL == sender, BLUETOOTH_ERROR_INVALID_PARAM);
        retv_if(NULL == address, BLUETOOTH_ERROR_INVALID_PARAM);
-       retv_if(0 > len && NULL == data, BLUETOOTH_ERROR_INVALID_PARAM);
+       retv_if(len > 0 && NULL == data, BLUETOOTH_ERROR_INVALID_PARAM);
 
        BT_DBG("+");
 
@@ -1779,9 +1778,7 @@ void _bt_tds_check_indication(const char *path, GVariant *msg)
 
                /* Send Indication & info removed internally */
                __bt_tds_send_indication_event(info, buffer, len);
-
-               if (value)
-                       g_variant_unref(value);
+               g_variant_unref(value);
        }
        BT_DBG("-");
 }