mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
regulator: isl9305: fix array size
[ Upstream commit0c08aaf873] 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:dec38b5ce6("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
23d76e6eb8
commit
23e4e7b49c
@@ -24,7 +24,7 @@
|
||||
struct regulator_init_data;
|
||||
|
||||
struct isl9305_pdata {
|
||||
struct regulator_init_data *init_data[ISL9305_MAX_REGULATOR];
|
||||
struct regulator_init_data *init_data[ISL9305_MAX_REGULATOR + 1];
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user