summaryrefslogtreecommitdiff
path: root/match.c
diff options
context:
space:
mode:
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;