diff options
author | Kay Sievers <kay@vrfy.org> | 2014-02-03 18:36:46 +0100 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2014-02-03 18:36:46 +0100 |
commit | 136bd94f3d890e129bbc391838ea1888e189830c (patch) | |
tree | a9aca01459b1cc2d482bb1a09963bfb3f24f2cbb | |
parent | 35ddf13d403ed79a4755dd6891749b6166918826 (diff) | |
download | kdbus-bus-136bd94f3d890e129bbc391838ea1888e189830c.tar.gz kdbus-bus-136bd94f3d890e129bbc391838ea1888e189830c.tar.bz2 kdbus-bus-136bd94f3d890e129bbc391838ea1888e189830c.zip |
save the bus when we fiddle with the function paramter
-rw-r--r-- | names.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -95,8 +95,7 @@ int kdbus_name_registry_new(struct kdbus_name_registry **reg) } static struct kdbus_name_entry * -__kdbus_name_lookup(struct kdbus_name_registry *reg, - u32 hash, const char *name) +__kdbus_name_lookup(struct kdbus_name_registry *reg, u32 hash, const char *name) { struct kdbus_name_entry *e; @@ -592,6 +591,7 @@ int kdbus_cmd_name_release(struct kdbus_name_registry *reg, struct kdbus_conn *conn, struct kdbus_cmd_name *cmd) { + struct kdbus_bus *bus = conn->bus; struct kdbus_name_entry *e; LIST_HEAD(notify_list); int ret = 0; @@ -602,7 +602,7 @@ int kdbus_cmd_name_release(struct kdbus_name_registry *reg, hash = kdbus_str_hash(cmd->name); - mutex_lock(&conn->bus->lock); + mutex_lock(&bus->lock); mutex_lock(®->entries_lock); e = __kdbus_name_lookup(reg, hash, cmd->name); if (!e) { @@ -613,12 +613,12 @@ int kdbus_cmd_name_release(struct kdbus_name_registry *reg, /* privileged users can act on behalf of someone else */ if (cmd->owner_id > 0) { - if (!kdbus_bus_uid_is_privileged(conn->bus)) { + if (!kdbus_bus_uid_is_privileged(bus)) { ret = -EPERM; goto exit_unlock; } - conn = kdbus_bus_find_conn_by_id(conn->bus, cmd->owner_id); + conn = kdbus_bus_find_conn_by_id(bus, cmd->owner_id); if (!conn) { ret = -ENXIO; goto exit_unlock; @@ -631,7 +631,7 @@ int kdbus_cmd_name_release(struct kdbus_name_registry *reg, exit_unlock: mutex_unlock(®->entries_lock); - mutex_unlock(&conn->bus->lock); + mutex_unlock(&bus->lock); if (conn) { kdbus_conn_kmsg_list_send(conn->ep, ¬ify_list); |