{
struct kdbus_bus *bus = container_of(kref, struct kdbus_bus, kref);
+ BUG_ON(!list_empty(&bus->ep_list));
+ BUG_ON(!list_empty(&bus->monitors_list));
+ BUG_ON(!hash_empty(bus->conn_hash));
+
kdbus_bus_disconnect(bus);
atomic_dec(&bus->user->buses);
kdbus_domain_user_unref(bus->user);
* @ep_list: Endpoints on this bus
* @bus_flags: Simple pass-through flags from userspace to userspace
* @name_registry: Domain's list of buses
- * @domain_entry: Domain's list of buses
+ * @domain_entry: Domain's list of buses
* @monitors_list: Connections that monitor this bus
* @bloom: Bloom parameters
* @id128: Unique random 128 bit ID of this bus
{
struct kdbus_conn *conn = container_of(kref, struct kdbus_conn, kref);
- kdbus_conn_disconnect(conn, false);
+ BUG_ON(!list_empty(&conn->msg_list));
+ BUG_ON(!list_empty(&conn->names_list));
+ BUG_ON(!list_empty(&conn->names_queue_list));
+ BUG_ON(!list_empty(&conn->reply_list));
+ kdbus_conn_disconnect(conn, false);
atomic_dec(&conn->user->connections);
kdbus_domain_user_unref(conn->user);
struct kdbus_domain *domain =
container_of(kref, struct kdbus_domain, kref);
+ BUG_ON(!list_empty(&domain->domain_list));
+ BUG_ON(!list_empty(&domain->bus_list));
+ BUG_ON(!hash_empty(domain->user_hash));
+
kdbus_domain_disconnect(domain);
kdbus_domain_unref(domain->parent);
kfree(domain->name);
{
struct kdbus_ep *ep = container_of(kref, struct kdbus_ep, kref);
+ BUG_ON(!list_empty(&ep->conn_list));
+
kdbus_ep_disconnect(ep);
kdbus_policy_db_free(ep->policy_db);
kdbus_bus_unref(ep->bus);
* @KDBUS_ATTACH_SECLABEL: The security label
* @KDBUS_ATTACH_AUDIT: The audit IDs
* @KDBUS_ATTACH_CONN_NAME: The human-readable connection name
+ * @_KDBUS_ATTACH_ALL: All of the above
*/
enum kdbus_attach_flags {
KDBUS_ATTACH_TIMESTAMP = 1 << 0,
size_t max_policies,
bool allow_wildcards,
const void *owner);
-
#endif