]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
regulator: max1586: zero-initialize regulator match table array
authorJavier Martinez Canillas <javier.martinez@collabora.co.uk>
Mon, 3 Nov 2014 14:40:40 +0000 (15:40 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 3 Nov 2014 15:36:50 +0000 (15:36 +0000)
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>
drivers/regulator/max1586.c

index 86db310d5304ad00dadcd605c6f9a9deb63a652c..d2a8c64cae42a9bc83890e922b7971781347ee62 100644 (file)
@@ -163,7 +163,7 @@ static int of_get_max1586_platform_data(struct device *dev,
                                 struct max1586_platform_data *pdata)
 {
        struct max1586_subdev_data *sub;
-       struct of_regulator_match rmatch[ARRAY_SIZE(max1586_reg)];
+       struct of_regulator_match rmatch[ARRAY_SIZE(max1586_reg)] = { };
        struct device_node *np = dev->of_node;
        int i, matched;