diff options
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/xenbus/xenbus_xs.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c index b3b8f2f3ad10..6f0121e3be69 100644 --- a/drivers/xen/xenbus/xenbus_xs.c +++ b/drivers/xen/xenbus/xenbus_xs.c | |||
@@ -810,6 +810,12 @@ static int process_msg(void) | |||
810 | goto out; | 810 | goto out; |
811 | } | 811 | } |
812 | 812 | ||
813 | if (msg->hdr.len > XENSTORE_PAYLOAD_MAX) { | ||
814 | kfree(msg); | ||
815 | err = -EINVAL; | ||
816 | goto out; | ||
817 | } | ||
818 | |||
813 | body = kmalloc(msg->hdr.len + 1, GFP_NOIO | __GFP_HIGH); | 819 | body = kmalloc(msg->hdr.len + 1, GFP_NOIO | __GFP_HIGH); |
814 | if (body == NULL) { | 820 | if (body == NULL) { |
815 | kfree(msg); | 821 | kfree(msg); |