From: Alexandre Bailon Date: Thu, 19 Nov 2015 11:44:46 +0000 (+0100) Subject: greybus: loopback: fix invalid response size X-Git-Tag: v4.14-rc1~2366^2~378^2~21^2~1034 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9864756be7542d3fe4e18297e0a45b5e2dec2f62;p=platform%2Fkernel%2Flinux-rpi.git 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 --- 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; }