struct hlist_node *tmp;
unsigned int i;
- mutex_lock(®->entries_lock);
+ mutex_lock(®->lock);
hash_for_each_safe(reg->entries_hash, i, tmp, e, hentry)
kdbus_name_entry_free(e);
- mutex_unlock(®->entries_lock);
+ mutex_unlock(®->lock);
kfree(reg);
}
return -ENOMEM;
hash_init(r->entries_hash);
- mutex_init(&r->entries_lock);
+ mutex_init(&r->lock);
*reg = r;
-
return 0;
}
mutex_unlock(&conn->lock);
}
-/* called with entries_lock held */
static int kdbus_name_replace_owner(struct kdbus_name_registry *reg,
struct kdbus_conn *conn,
struct kdbus_name_entry *e, u64 flags,
{
int ret;
+ BUG_ON(!mutex_is_locked(®->lock));
+
ret = kdbus_notify_name_change(KDBUS_ITEM_NAME_CHANGE,
e->conn->id, conn->id,
e->flags, flags,
mutex_unlock(&conn->lock);
mutex_lock(&conn->bus->lock);
- mutex_lock(®->entries_lock);
+ mutex_lock(®->lock);
if (conn->flags & KDBUS_HELLO_ACTIVATOR) {
activator = conn->activator_of->activator;
conn->activator_of->activator = NULL;
kdbus_name_queue_item_free(q);
list_for_each_entry_safe(e, e_tmp, &names_list, conn_entry)
kdbus_name_entry_release(e, ¬ify_list);
- mutex_unlock(®->entries_lock);
+ mutex_unlock(®->lock);
mutex_unlock(&conn->bus->lock);
kdbus_conn_unref(activator);
struct kdbus_name_entry *e = NULL;
u32 hash = kdbus_str_hash(name);
- mutex_lock(®->entries_lock);
+ mutex_lock(®->lock);
e = __kdbus_name_lookup(reg, hash, name);
- mutex_unlock(®->entries_lock);
+ mutex_unlock(®->lock);
return e;
}
hash = kdbus_str_hash(name);
mutex_lock(&conn->bus->lock);
- mutex_lock(®->entries_lock);
+ mutex_lock(®->lock);
e = __kdbus_name_lookup(reg, hash, name);
if (e) {
*entry = e;
exit_unlock:
- mutex_unlock(®->entries_lock);
+ mutex_unlock(®->lock);
mutex_unlock(&conn->bus->lock);
kdbus_conn_kmsg_list_send(conn->ep, ¬ify_list);
hash = kdbus_str_hash(cmd->name);
mutex_lock(&bus->lock);
- mutex_lock(®->entries_lock);
+ mutex_lock(®->lock);
e = __kdbus_name_lookup(reg, hash, cmd->name);
if (!e) {
ret = -ESRCH;
ret = kdbus_name_release(e, conn, ¬ify_list);
exit_unlock:
- mutex_unlock(®->entries_lock);
+ mutex_unlock(®->lock);
mutex_unlock(&bus->lock);
if (conn) {
policy_db = conn->ep->policy_db;
mutex_lock(&conn->bus->lock);
- mutex_lock(®->entries_lock);
+ mutex_lock(®->lock);
if (policy_db)
mutex_lock(&policy_db->entries_lock);
if (policy_db)
mutex_unlock(&policy_db->entries_lock);
- mutex_unlock(®->entries_lock);
+ mutex_unlock(®->lock);
mutex_unlock(&conn->bus->lock);
return ret;