From 9864756be7542d3fe4e18297e0a45b5e2dec2f62 Mon Sep 17 00:00:00 2001 From: Alexandre Bailon Date: Thu, 19 Nov 2015 12:44:46 +0100 Subject: [PATCH] greybus: loopback: fix invalid response size The size of timestamps is not taken into account, which makes the loopback driver in the firmware drop invalid packages. Signed-off-by: Alexandre Bailon Signed-off-by: Bartosz Golaszewski Reviewed-by: Johan Hovold Reviewed-by: Bryan O'Donoghue Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/loopback.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c index 9a44dcc..ec68247 100644 --- a/drivers/staging/greybus/loopback.c +++ b/drivers/staging/greybus/loopback.c @@ -534,8 +534,8 @@ static int gb_loopback_request_recv(u8 type, struct gb_operation *operation) } if (len) { - if (!gb_operation_response_alloc(operation, len, - GFP_KERNEL)) { + if (!gb_operation_response_alloc(operation, + len + sizeof(*response), GFP_KERNEL)) { dev_err(dev, "error allocating response\n"); return -ENOMEM; } -- 2.7.4