platform/chrome: fix memory corruption in ioctl
[ Upstream commit
4963e118e3dd120c7acc14c19648290ff6ba9a55 ]
If "s_mem.bytes" is larger than the buffer size it leads to memory
corruption.
Fixes: 8c93ae858843 ("mfd / platform: cros_ec: Miscellaneous character device to talk with the EC")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/Yv8dpCFZJdbUT5ye@kili
Signed-off-by: Sasha Levin <sashal@kernel.org>