summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-11-06 15:21:20 -0700
committerSimon Glass <sjg@chromium.org>2018-11-20 19:14:22 -0700
commitdc05ac0f2f3a5b2f301e2790afe45cb11cf0258f (patch)
tree82d670c658c6d49bd943755c46a925194150af73 /drivers/misc
parentac80652342dafa5356cd25959f1c45d003ba9dcf (diff)
downloadu-boot-dc05ac0f2f3a5b2f301e2790afe45cb11cf0258f.tar.gz
u-boot-dc05ac0f2f3a5b2f301e2790afe45cb11cf0258f.tar.bz2
u-boot-dc05ac0f2f3a5b2f301e2790afe45cb11cf0258f.zip
cros_ec: Fail if we cannot determine the flash burst size
This value is required for flashing to work correctly. Add a check for it. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/cros_ec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/misc/cros_ec.c b/drivers/misc/cros_ec.c
index e0f3dfc98e..7daf16499a 100644
--- a/drivers/misc/cros_ec.c
+++ b/drivers/misc/cros_ec.c
@@ -827,6 +827,9 @@ int cros_ec_flash_write(struct udevice *dev, const uint8_t *data,
uint32_t end, off;
int ret;
+ if (!burst)
+ return -EINVAL;
+
/*
* TODO: round up to the nearest multiple of write size. Can get away
* without that on link right now because its write size is 4 bytes.