connection: remove redundant variable
authorDavid Herrmann <dh.herrmann@gmail.com>
Thu, 8 Jan 2015 15:45:10 +0000 (16:45 +0100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Thu, 8 Jan 2015 15:45:10 +0000 (16:45 +0100)
'allowed' is equivalent to '!!r' so drop it.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
connection.c

index aa9d2559e95eb75cf4bdfd6b3426c8f9aef61e4f..4c7d3de020e3f300df751ee5e586b8b1c023d52b 100644 (file)
@@ -242,7 +242,6 @@ static int kdbus_conn_check_access(struct kdbus_conn *conn_src,
         */
        if (reply_wake && msg->cookie_reply > 0) {
                struct kdbus_reply *r;
-               bool allowed = false;
 
                /*
                 * The connection that we are replying to has not
@@ -261,12 +260,10 @@ static int kdbus_conn_check_access(struct kdbus_conn *conn_src,
                                *reply_wake = kdbus_reply_ref(r);
                        else
                                kdbus_reply_unref(r);
-
-                       allowed = true;
                }
                mutex_unlock(&conn_dst->lock);
 
-               return allowed ? 0 : -EPERM;
+               return r ? 0 : -EPERM;
        }
 
        /* ... otherwise, ask the policy DBs for permission */