]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
greybus: es1: fix buffer-size limit
authorJohan Hovold <johan@hovoldconsulting.com>
Tue, 7 Apr 2015 09:27:11 +0000 (11:27 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 7 Apr 2015 12:32:42 +0000 (14:32 +0200)
The maximum buffer size does not include the headroom, so subtract the
headroom size from the actual buffer size.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/es1.c

index f2c1cde9622136a8d8c6c6cf1d0e38a6c0b53971..b9fd5111d3f92e4a447484690134978f8caa5b6b 100644 (file)
@@ -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);
 }