mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-29 23:53:55 +08:00
0c08aaf873
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>
31 lines
704 B
C
31 lines
704 B
C
/*
|
|
* isl9305 - Intersil ISL9305 DCDC regulator
|
|
*
|
|
* Copyright 2014 Linaro Ltd
|
|
*
|
|
* Author: Mark Brown <broonie@kernel.org>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published by the
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
* option) any later version.
|
|
*/
|
|
|
|
#ifndef __ISL9305_H
|
|
#define __ISL9305_H
|
|
|
|
#define ISL9305_DCD1 0
|
|
#define ISL9305_DCD2 1
|
|
#define ISL9305_LDO1 2
|
|
#define ISL9305_LDO2 3
|
|
|
|
#define ISL9305_MAX_REGULATOR ISL9305_LDO2
|
|
|
|
struct regulator_init_data;
|
|
|
|
struct isl9305_pdata {
|
|
struct regulator_init_data *init_data[ISL9305_MAX_REGULATOR + 1];
|
|
};
|
|
|
|
#endif
|