summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Chevallier <maxime.chevallier@bootlin.com>2023-06-07 16:59:37 +0300
committerJakub Kicinski <kuba@kernel.org>2023-06-07 23:30:11 +0300
commit2d830f7a41343302ab19e73d4f44f5ccb6940a25 (patch)
treec82b68d6772aa03bf882c1c514ceb953ecf531a7
parent6878eb59d92cc0aff170179480dc32795ac7513b (diff)
downloadlinux-2d830f7a41343302ab19e73d4f44f5ccb6940a25.tar.xz
net: altera-tse: Initialize local structs before using it
The regmap_config and mdio_regmap_config objects needs to be zeroed before using them. This will cause spurious errors at probe time as config->pad_bits is containing random uninitialized data. Fixes: db48abbaa18e ("net: ethernet: altera-tse: Convert to mdio-regmap and use PCS Lynx") Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/ethernet/altera/altera_tse_main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c
index d866c0f1b503..215f9fb89c5b 100644
--- a/drivers/net/ethernet/altera/altera_tse_main.c
+++ b/drivers/net/ethernet/altera/altera_tse_main.c
@@ -1255,6 +1255,8 @@ static int altera_tse_probe(struct platform_device *pdev)
if (ret)
goto err_free_netdev;
+ memset(&pcs_regmap_cfg, 0, sizeof(pcs_regmap_cfg));
+ memset(&mrc, 0, sizeof(mrc));
/* SGMII PCS address space. The location can vary depending on how the
* IP is integrated. We can have a resource dedicated to it at a specific
* address space, but if it's not the case, we fallback to the mdiophy0