Merge tag 'for-linus-4.6-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-block.git] / drivers / xen / xenbus / xenbus_dev_frontend.c
index 8c0a359ab4a8620ae8343294acd77d6be4c8deb6..cacf30d14747baa20d5f2d8a6a999ebdcba14018 100644 (file)
@@ -186,6 +186,8 @@ static int queue_reply(struct list_head *queue, const void *data, size_t len)
 
        if (len == 0)
                return 0;
+       if (len > XENSTORE_PAYLOAD_MAX)
+               return -EINVAL;
 
        rb = kmalloc(sizeof(*rb) + len, GFP_KERNEL);
        if (rb == NULL)