From: Michal Bloch Date: Wed, 2 Feb 2022 18:29:22 +0000 (+0100) Subject: Fix disabling kdbus policy resulting in dead code X-Git-Tag: submit/tizen_6.5/20220314.044848~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d48397e6b698d1cdaf091e6166a11535fe3e4d1d;p=platform%2Fkernel%2Flinux-tizen-modules-source.git Fix disabling kdbus policy resulting in dead code Change-Id: Ifb6357b7d4a4a35e9663df2c19ba25361485de14 Signed-off-by: Michal Bloch (cherry picked from commit 00205108656011791ca36134ae6d9a95b4ef7727) --- diff --git a/kernel/kdbus/connection.c b/kernel/kdbus/connection.c index a40be5f..b472e36 100644 --- a/kernel/kdbus/connection.c +++ b/kernel/kdbus/connection.c @@ -1428,7 +1428,7 @@ bool kdbus_conn_policy_own_name(struct kdbus_conn *conn, #ifdef DISABLE_KDBUS_POLICY return true; -#endif +#else if (!conn_creds) conn_creds = conn->cred; @@ -1446,6 +1446,7 @@ bool kdbus_conn_policy_own_name(struct kdbus_conn *conn, res = kdbus_policy_query(&conn->ep->bus->policy_db, conn_creds, name, hash); return res >= KDBUS_POLICY_OWN; +#endif } /** @@ -1465,7 +1466,7 @@ bool kdbus_conn_policy_talk(struct kdbus_conn *conn, #ifdef DISABLE_KDBUS_POLICY return true; -#endif +#else if (!conn_creds) conn_creds = conn->cred; @@ -1483,6 +1484,7 @@ bool kdbus_conn_policy_talk(struct kdbus_conn *conn, return kdbus_conn_policy_query_all(conn, conn_creds, &conn->ep->bus->policy_db, to, KDBUS_POLICY_TALK); +#endif } /** @@ -1505,7 +1507,7 @@ bool kdbus_conn_policy_see_name_unlocked(struct kdbus_conn *conn, #ifdef DISABLE_KDBUS_POLICY return true; -#endif +#else /* * By default, all names are visible on a bus. SEE policies can only be @@ -1518,6 +1520,7 @@ bool kdbus_conn_policy_see_name_unlocked(struct kdbus_conn *conn, conn_creds ? : conn->cred, name, kdbus_strhash(name)); return res >= KDBUS_POLICY_SEE; +#endif } static bool kdbus_conn_policy_see_name(struct kdbus_conn *conn, @@ -1540,7 +1543,7 @@ static bool kdbus_conn_policy_see(struct kdbus_conn *conn, #ifdef DISABLE_KDBUS_POLICY return true; -#endif +#else /* * By default, all names are visible on a bus, so a connection can @@ -1553,6 +1556,7 @@ static bool kdbus_conn_policy_see(struct kdbus_conn *conn, kdbus_conn_policy_query_all(conn, conn_creds, &conn->ep->policy_db, whom, KDBUS_POLICY_SEE); +#endif } /**