Enhance debug message
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / bt-service-gap-agent.c
index d8d4b19..dccf480 100644 (file)
@@ -112,8 +112,6 @@ gboolean _gap_agent_register_osp_server(GapAgentPrivate *agent,
                return FALSE;
 
        server = g_malloc0(sizeof(bt_agent_osp_server_t));
-       retv_if(server == NULL, FALSE);
-
        server->type = type;
        if (type == BT_RFCOMM_SERVER) {
                server->uuid = g_strdup(uuid);
@@ -650,9 +648,8 @@ static void __bt_gap_agent_method(GDBusConnection *connection,
                        addr += 4;
                        g_strlcpy(agent->pairing_addr, addr, sizeof(agent->pairing_addr));
 
-                       while ((pos = strchr(agent->pairing_addr, '_')) != NULL) {
+                       while ((pos = strchr(agent->pairing_addr, '_')) != NULL)
                                *pos = ':';
-                       }
                }
 
                agent->cb.pincode_func(agent, device);
@@ -716,9 +713,8 @@ static void __bt_gap_agent_method(GDBusConnection *connection,
                        addr += 4;
                        g_strlcpy(priv->pairing_addr, addr, sizeof(priv->pairing_addr));
 
-                       while ((pos = strchr(priv->pairing_addr, '_')) != NULL) {
+                       while ((pos = strchr(priv->pairing_addr, '_')) != NULL)
                                *pos = ':';
-                       }
                }
 
                priv->cb.passkey_func(priv, device);
@@ -845,9 +841,8 @@ static void __bt_gap_agent_method(GDBusConnection *connection,
                        addr += 4;
                        g_strlcpy(priv->pairing_addr, addr, sizeof(priv->pairing_addr));
 
-                       while ((pos = strchr(priv->pairing_addr, '_')) != NULL) {
+                       while ((pos = strchr(priv->pairing_addr, '_')) != NULL)
                                *pos = ':';
-                       }
                }
 
                priv->cb.confirm_func(priv, device, passkey);
@@ -915,9 +910,8 @@ static void __bt_gap_agent_method(GDBusConnection *connection,
                        g_strlcpy(priv->authorize_addr, addr,
                                                        sizeof(priv->authorize_addr));
 
-                       while ((pos = strchr(priv->authorize_addr, '_')) != NULL) {
+                       while ((pos = strchr(priv->authorize_addr, '_')) != NULL)
                                *pos = ':';
-                       }
                }
 
                priv->cb.authorize_func(priv, device, uuid);
@@ -1120,8 +1114,8 @@ void _gap_agent_setup_dbus(GapAgentPrivate *agent, GAP_AGENT_FUNC_CB *func_cb,
                priv->busname = NULL;
        } else {
                priv->busname = g_strdup(g_dbus_proxy_get_name(proxy));
-               g_object_unref(proxy);
                BT_DBG("Busname: %s", priv->busname);
+               g_object_unref(proxy);
        }
 
 }
@@ -1183,9 +1177,8 @@ bt_agent_osp_server_t *_gap_agent_get_osp_server(GapAgentPrivate *agent, int typ
 
        osp_serv = __gap_agent_find_server(priv->osp_servers,
                        type, uuid);
-       if (!osp_serv) {
+       if (!osp_serv)
                return NULL;
-       }
 
        return osp_serv;
 }