Skip to content

Commit

Permalink
net: altera-tse: Initialize local structs before using it
Browse files Browse the repository at this point in the history
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: db48abb ("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>
  • Loading branch information
Maxime Chevallier authored and Jakub Kicinski committed Jun 7, 2023
1 parent 6878eb5 commit 2d830f7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/altera/altera_tse_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2d830f7

Please sign in to comment.