diff options
author | Djalal Harouni <tixxdz@opendz.org> | 2014-03-31 01:43:04 +0100 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2014-03-31 14:31:12 +0200 |
commit | b9ed5f94de3e513855dcfbe8515b6648f26d0701 (patch) | |
tree | f293661932a95b60e639e8c4572cdded1e1d33fe /match.c | |
parent | db4ebe9c2778116e22848dba4428c20ff972e16c (diff) | |
download | kdbus-bus-b9ed5f94de3e513855dcfbe8515b6648f26d0701.tar.gz kdbus-bus-b9ed5f94de3e513855dcfbe8515b6648f26d0701.tar.bz2 kdbus-bus-b9ed5f94de3e513855dcfbe8515b6648f26d0701.zip |
kdbus: use kdbus_conn_find_peer() where appropriate
Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
Diffstat (limited to 'match.c')
-rw-r--r-- | match.c | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -358,12 +358,7 @@ int kdbus_match_db_add(struct kdbus_conn *conn, return -EPERM; if (cmd->owner_id != 0 && cmd->owner_id != conn->id) { - struct kdbus_bus *bus = conn->bus; - - mutex_lock(&bus->lock); - target_conn = kdbus_bus_find_conn_by_id(bus, cmd->owner_id); - mutex_unlock(&bus->lock); - + target_conn = kdbus_conn_find_peer(conn, cmd->owner_id); if (!target_conn) { ret = -ENXIO; goto exit_free; @@ -534,12 +529,7 @@ int kdbus_match_db_remove(struct kdbus_conn *conn, return -EPERM; if (cmd->owner_id != 0 && cmd->owner_id != conn->id) { - struct kdbus_bus *bus = conn->bus; - - mutex_lock(&bus->lock); - target_conn = kdbus_bus_find_conn_by_id(bus, cmd->owner_id); - mutex_unlock(&bus->lock); - + target_conn = kdbus_conn_find_peer(conn, cmd->owner_id); if (!target_conn) return -ENXIO; |