Skip to content

Commit d83aef1

Browse files
Javier Martinez Canillasbroonie
authored andcommitted
regulator: max1586: zero-initialize regulator match table array
The struct of_regulator_match rmatch[] is declared as a non-static local variable so the structure members are not auto-initialized. Initialize the array at declaration time to avoid the structure members values to be indeterminate and have sane defaults instead. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent f114040 commit d83aef1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/regulator/max1586.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static int of_get_max1586_platform_data(struct device *dev,
163163
struct max1586_platform_data *pdata)
164164
{
165165
struct max1586_subdev_data *sub;
166-
struct of_regulator_match rmatch[ARRAY_SIZE(max1586_reg)];
166+
struct of_regulator_match rmatch[ARRAY_SIZE(max1586_reg)] = { };
167167
struct device_node *np = dev->of_node;
168168
int i, matched;
169169

0 commit comments

Comments
 (0)