diff options
Diffstat (limited to 'drivers/misc/cros_ec.c')
-rw-r--r-- | drivers/misc/cros_ec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/misc/cros_ec.c b/drivers/misc/cros_ec.c index ce5fa5bee3..e51ac87409 100644 --- a/drivers/misc/cros_ec.c +++ b/drivers/misc/cros_ec.c @@ -404,6 +404,8 @@ static int ec_command(struct udevice *dev, uint cmd, int cmd_version, */ if (din && in_buffer) { assert(len <= din_len); + if (len > din_len) + return -ENOSPC; memmove(din, in_buffer, len); } } |