Skip to content

Commit 0c08aaf

Browse files
vstehlebroonie
authored andcommitted
regulator: isl9305: fix array size
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: dec38b5 ("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>
1 parent d00b746 commit 0c08aaf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

include/linux/platform_data/isl9305.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
struct regulator_init_data;
2525

2626
struct isl9305_pdata {
27-
struct regulator_init_data *init_data[ISL9305_MAX_REGULATOR];
27+
struct regulator_init_data *init_data[ISL9305_MAX_REGULATOR + 1];
2828
};
2929

3030
#endif

0 commit comments

Comments
 (0)