connection: don't pass NULL to f->poll()
authorDavid Herrmann <dh.herrmann@gmail.com>
Fri, 19 Dec 2014 18:54:03 +0000 (19:54 +0100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Fri, 19 Dec 2014 18:55:49 +0000 (19:55 +0100)
We must never pass NULL to f->poll(). Instead, we reset the callback to
NULL, thus the poll function will never add more queues.

We already do this via init_poll_funcptr(&xyz, NULL) so we can safely pass
the poll context everytime. This also allows us to drop the first dummy
call to ->poll().

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

index 270d8968eff41efcf457896ac08fe251d76b38a3..c5136b7cd30966600d2904b842ba57f797cd74d1 100644 (file)
@@ -655,8 +655,6 @@ static int kdbus_conn_wait_reply(struct kdbus_conn *conn_src,
                        fput(cancel_fd);
                        return -EINVAL;
                }
-
-               cancel_fd->f_op->poll(cancel_fd, &pwq.pt);
        }
 
        sigmask_item = kdbus_items_get(cmd_send->items,
@@ -696,7 +694,7 @@ static int kdbus_conn_wait_reply(struct kdbus_conn *conn_src,
                if (cancel_fd) {
                        unsigned int r;
 
-                       r = cancel_fd->f_op->poll(cancel_fd, NULL);
+                       r = cancel_fd->f_op->poll(cancel_fd, &pwq.pt);
                        if (r & POLLIN) {
                                ret = -ECANCELED;
                                break;