I'm not aware of any chip having a write size bigger than 2048 today.
Still checking for that instead of a sleeping problem to bite us maybe
in a few years is easy.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
else
len = 256;
+ if (len > sizeof(buf)) {
+ printf("huh, writesize (%d) bigger than buffer (%zu)\n",
+ len, sizeof(buf));
+ return ENOMEM;
+ }
+
wrote = 0;
while ((size = xread(0, buf, len))) {
if (size < 0) {