Revert "kdbus: do not append the same connection to the queue twice"
authorKonrad Lipinski <konrad.l@samsung.com>
Thu, 8 Sep 2016 14:47:33 +0000 (16:47 +0200)
committerKonrad Lipinski <konrad.l@samsung.com>
Fri, 9 Sep 2016 11:26:24 +0000 (13:26 +0200)
This reverts commit 204d5d1ebd6966496c98b2b8ef29075b7b77a2fa.

ipc/kdbus/names.c

index df99e4df815b2e678ebc648bdf963b1940fdc56d..657008e1bb37b3daa734dbba17226d2b0e8056a2 100644 (file)
@@ -353,24 +353,10 @@ int kdbus_name_acquire(struct kdbus_name_registry *reg,
        } else if (flags & KDBUS_NAME_QUEUE) {
                /* add to waiting-queue of the name */
 
-               struct kdbus_name_pending *p;
-               bool in_queue = false;
-
-               list_for_each_entry(p, &e->queue, name_entry) {
-                       if (p->conn == conn) {
-                               /* connection is already queued */
-                               rflags |= KDBUS_NAME_IN_QUEUE;
-                               in_queue = true;
-                               break;
-                       }
-               }
-
-               if (!in_queue) {
-                       ret = kdbus_name_pending_new(e, conn, flags);
-                       if (ret >= 0)
-                               /* tell the caller that we queued it */
-                               rflags |= KDBUS_NAME_IN_QUEUE;
-               }
+               ret = kdbus_name_pending_new(e, conn, flags);
+               if (ret >= 0)
+                       /* tell the caller that we queued it */
+                       rflags |= KDBUS_NAME_IN_QUEUE;
        } else {
                /* the name is busy, return a failure */
                ret = -EEXIST;