cros_ec: fix nul-termination for firmware build info
authorArnd Bergmann <arnd@arndb.de>
Mon, 4 Dec 2017 14:49:48 +0000 (15:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Mar 2018 10:01:23 +0000 (11:01 +0100)
commit008029510ac8c44a8421180d8d71b3e9c95c909f
tree077aea409e0e037aa37887059f01e7f35259749a
parent79c3f5cf466df5d04c2aa6d837f23cd91f48a776
cros_ec: fix nul-termination for firmware build info

[ Upstream commit 50a0d71a5d20e1d3eff1d974fdc8559ad6d74892 ]

As gcc-8 reports, we zero out the wrong byte:

drivers/platform/chrome/cros_ec_sysfs.c: In function 'show_ec_version':
drivers/platform/chrome/cros_ec_sysfs.c:190:12: error: array subscript 4294967295 is above array bounds of 'uint8_t[]' [-Werror=array-bounds]

This changes the code back to what it did before changing to a
zero-length array structure.

Fixes: a841178445bb ("mfd: cros_ec: Use a zero-length array for command data")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/platform/chrome/cros_ec_sysfs.c