Minor optimization, before locking the endpoint policy db in order to
check for TALK access, check first that the destination match db is
interested in the signal.
Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
goto exit_unref;
}
} else if (msg->flags & KDBUS_MSG_SIGNAL) {
+ if (!kdbus_match_db_match_kmsg(conn_dst->match_db,
+ conn_src, kmsg)) {
+ ret = -EPERM;
+ goto exit_unref;
+ }
+
/*
* A receiver needs TALK access to the sender
* in order to receive signals.
msg, NULL);
if (ret < 0)
goto exit_unref;
-
- if (!kdbus_match_db_match_kmsg(conn_dst->match_db,
- conn_src, kmsg)) {
- ret = -EPERM;
- goto exit_unref;
- }
} else {
ret = kdbus_conn_check_access(conn_src, conn_dst,
msg, &reply_wake);