OSDN Git Service

regulator: isl9305: fix array size
authorVincent Stehlé <vincent.stehle@laposte.net>
Sun, 9 Apr 2017 20:05:05 +0000 (22:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Mar 2018 08:23:25 +0000 (09:23 +0100)
commit23e4e7b49c65500cf4a4e494ee62076b009d29e6
tree748a2cbd94d2231b5e0cf01e94ce5f9e0eaf291b
parent23d76e6eb830e948785eaa412c027c7a602578f4
regulator: isl9305: fix array size

[ Upstream commit 0c08aaf873174c95e674cf21ffcd041c589d2e5b ]

ISL9305_MAX_REGULATOR is the last index used to access the init_data[]
array, so we need to add one to this last index to obtain the necessary
array size.

This fixes the following smatch error:

  drivers/regulator/isl9305.c:160 isl9305_i2c_probe() error: buffer overflow 'pdata->init_data' 3 <= 3

Fixes: dec38b5ce6a9edb4 ("regulator: isl9305: Add Intersil ISL9305/H driver")
Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/platform_data/isl9305.h