static void owner_disconnect(DBusConnection *connection, void *user_data)
{
- struct connman_session *session;
- char *owner = user_data;
-
- DBG("%s died", owner);
+ struct connman_session *session = user_data;
- session = g_hash_table_lookup(session_hash, owner);
- if (session == NULL) {
- connman_error("No session");
- return;
- }
+ DBG("%s died", session->owner);
session_disconnect(session);
}
session->bearer = bearer;
session->watch = g_dbus_add_disconnect_watch(connection, session->owner,
- owner_disconnect, session->owner, NULL);
+ owner_disconnect, session, NULL);
return session->service;
failed_bearer: