handle: properly reset output arguments to 0
authorDavid Herrmann <dh.herrmann@gmail.com>
Thu, 8 Jan 2015 16:06:40 +0000 (17:06 +0100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Thu, 8 Jan 2015 16:48:55 +0000 (17:48 +0100)
Make sure all output arguments are set to 0 so we can copy them once we're
done with the ioctl, regardless whether they were set previously.

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

index 8729cdd0648ceb9faed7e39345162387f057a8c3..b1a1e8e264fad8963fb15e5ebef7f9279fab9f50 100644 (file)
--- a/handle.c
+++ b/handle.c
@@ -687,6 +687,9 @@ static long handle_ep_ioctl_connected(struct file *file, unsigned int cmd,
                        break;
 
                cmd_send->return_flags = 0;
+               cmd_send->reply.offset = 0;
+               cmd_send->reply.msg_size = 0;
+               cmd_send->reply.return_flags = 0;
 
                ret = kdbus_items_validate(cmd_send->items,
                                           KDBUS_ITEMS_SIZE(cmd_send, items));
@@ -749,6 +752,10 @@ static long handle_ep_ioctl_connected(struct file *file, unsigned int cmd,
                        break;
 
                cmd_recv->return_flags = 0;
+               cmd_recv->dropped_msgs = 0;
+               cmd_recv->reply.offset = 0;
+               cmd_recv->reply.msg_size = 0;
+               cmd_recv->reply.return_flags = 0;
 
                ret = kdbus_items_validate(cmd_recv->items,
                                           KDBUS_ITEMS_SIZE(cmd_recv, items));