summaryrefslogtreecommitdiff
path: root/match.c
diff options
context:
space:
mode:
authorDjalal Harouni <tixxdz@opendz.org>2014-03-31 01:43:04 +0100
committerKay Sievers <kay@vrfy.org>2014-03-31 14:31:12 +0200
commitb9ed5f94de3e513855dcfbe8515b6648f26d0701 (patch)
treef293661932a95b60e639e8c4572cdded1e1d33fe /match.c
parentdb4ebe9c2778116e22848dba4428c20ff972e16c (diff)
downloadkdbus-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.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/match.c b/match.c
index 4a12a24300b..ccc4042bb33 100644
--- a/match.c
+++ b/match.c
@@ -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;