endpoint: clean up kdbus_ep_policy_check_see_access_unlocked()
authorDaniel Mack <daniel@zonque.org>
Tue, 30 Sep 2014 21:44:05 +0000 (23:44 +0200)
committerDaniel Mack <daniel@zonque.org>
Tue, 30 Sep 2014 21:57:03 +0000 (23:57 +0200)
Just a cosmetic cleanup.

Signed-off-by: Daniel Mack <daniel@zonque.org>
endpoint.c

index 04a63d9bbcee4958f19a5891d2d742fd84b67777..f9c78c67ca4e267cdd3b87631f98881c0c37ef84 100644 (file)
@@ -282,8 +282,6 @@ int kdbus_ep_policy_check_see_access_unlocked(struct kdbus_ep *ep,
                                              struct kdbus_conn *conn,
                                              const char *name)
 {
-       int ret;
-
        /*
         * Check policy, if the endpoint of the connection has a db.
         * Note that policy DBs instanciated along with connections
@@ -296,14 +294,11 @@ int kdbus_ep_policy_check_see_access_unlocked(struct kdbus_ep *ep,
         * same.
         */
 
-       if (ep->has_policy) {
-               ret = kdbus_policy_check_see_access_unlocked(&ep->policy_db,
-                                                            conn, name);
-               if (ret < 0)
-                       return ret;
-       }
+       if (!ep->has_policy)
+               return 0;
 
-       return 0;
+       return kdbus_policy_check_see_access_unlocked(&ep->policy_db,
+                                                     conn, name);
 }
 
 /**