From: Johan Hovold Date: Tue, 7 Apr 2015 09:27:11 +0000 (+0200) Subject: greybus: es1: fix buffer-size limit X-Git-Tag: v4.9-rc1~119^2~378^2~21^2~1603 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=bfd9a94d1aa2a8592749342d8024543ae3ff9e57;p=karo-tx-linux.git greybus: es1: fix buffer-size limit The maximum buffer size does not include the headroom, so subtract the headroom size from the actual buffer size. Signed-off-by: Johan Hovold Reviewed-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/es1.c b/drivers/staging/greybus/es1.c index f2c1cde96221..b9fd5111d3f9 100644 --- a/drivers/staging/greybus/es1.c +++ b/drivers/staging/greybus/es1.c @@ -132,7 +132,7 @@ static void hd_buffer_constraints(struct greybus_host_device *hd) * that's better aligned for the user. */ hd->buffer_headroom = sizeof(u32); /* For cport id */ - hd->buffer_size_max = ES1_GBUF_MSG_SIZE_MAX; + hd->buffer_size_max = ES1_GBUF_MSG_SIZE_MAX - hd->buffer_headroom; BUILD_BUG_ON(hd->buffer_headroom > GB_BUFFER_HEADROOM_MAX); }