aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/stmicro
diff options
context:
space:
mode:
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>2019-06-18 22:39:27 +0200
committerDavid S. Miller <davem@davemloft.net>2019-06-19 17:40:49 -0400
commit84ce4d0f9f55b4f4ca4d4edcbb54a23d9dad1aae (patch)
tree799526c7d6ed8338c67c2fa2b4cb5c58c3f785c8 /drivers/net/ethernet/stmicro
parentselftests/net: make udpgso_bench skip unsupported testcases (diff)
downloadlinux-dev-84ce4d0f9f55b4f4ca4d4edcbb54a23d9dad1aae.tar.xz
linux-dev-84ce4d0f9f55b4f4ca4d4edcbb54a23d9dad1aae.zip
net: stmmac: initialize the reset delay array
Commit ce4ab73ab0c27c ("net: stmmac: drop the reset delays from struct stmmac_mdio_bus_data") moved the reset delay array from struct stmmac_mdio_bus_data to a stack variable. The values from the array inside struct stmmac_mdio_bus_data were previously initialized to 0 because the struct was allocated using devm_kzalloc(). The array on the stack has to be initialized explicitly, else we might be reading garbage values. Initialize all reset delays to 0 to ensure that the values are 0 if the "snps,reset-delays-us" property is not defined. This fixes booting at least two boards (MIPS pistachio marduk and ARM sun8i H2+ Orange Pi Zero). These are hanging during boot when initializing the stmmac Ethernet controller (as found by Kernel CI). Both have in common that they don't define the "snps,reset-delays-us" property. Fixes: ce4ab73ab0c27c ("net: stmmac: drop the reset delays from struct stmmac_mdio_bus_data") Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Reported-by: "kernelci.org bot" <bot@kernelci.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index 5b7923c0698c..f8061e34122f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -241,7 +241,7 @@ int stmmac_mdio_reset(struct mii_bus *bus)
#ifdef CONFIG_OF
if (priv->device->of_node) {
struct gpio_desc *reset_gpio;
- u32 delays[3];
+ u32 delays[3] = { 0, 0, 0 };
int ret;
reset_gpio = devm_gpiod_get_optional(priv->device,