greybus: uart: add max-payload sanity check
authorJohan Hovold <johan@hovoldconsulting.com>
Wed, 24 Feb 2016 15:11:49 +0000 (16:11 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 25 Feb 2016 01:26:05 +0000 (17:26 -0800)
commit066f950c65c206c1a1a2f72f2c80134177ea3999
treeaeeb55b8af96f565673b7841420003e985f56b6f
parent71f6c3231c1dce6980f97b7bc7ed7ac32faac550
greybus: uart: add max-payload sanity check

Let's be well behaved and add a sanity check on the maximum greybus
payload size to avoid underflow on the calculated buffer size.

Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/uart.c