diff options
author | Dinh Nguyen <dinguyen@kernel.org> | 2022-04-07 08:25:21 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-04-20 09:19:35 +0200 |
commit | 7e59fdf9547c4f948d1d917ec7ffa5fb5ac53bdb (patch) | |
tree | 8471f50b9f78742882c4e2d16657b67f6f8de51c /net | |
parent | 94541468c11ac680c90b8f480a2f1b43d998f682 (diff) |
net: ethernet: stmmac: fix altr_tse_pcs function when using a fixed-link
[ Upstream commit a6aaa00324240967272b451bfa772547bd576ee6 ]
When using a fixed-link, the altr_tse_pcs driver crashes
due to null-pointer dereference as no phy_device is provided to
tse_pcs_fix_mac_speed function. Fix this by adding a check for
phy_dev before calling the tse_pcs_fix_mac_speed() function.
Also clean up the tse_pcs_fix_mac_speed function a bit. There is
no need to check for splitter_base and sgmii_adapter_base
because the driver will fail if these 2 variables are not
derived from the device tree.
Fixes: fb3bbdb85989 ("net: ethernet: Add TSE PCS support to dwmac-socfpga")
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions