net: stmmac: Add NULL check

Add NULL check before accessing phy.

Change-Id: Iba5206cea1a06b81ea6b884ece17561b46fcf65e
Signed-off-by: Suraj Jaiswal <jsuraj@codeaurora.org>
This commit is contained in:
Suraj Jaiswal 2021-03-26 10:25:20 +05:30 • committed by Gerrit - the friendly Code Review server
commit 750a0962bd

View file

@ -998,7 +998,7 @@ static void stmmac_mac_link_up(struct phylink_config *config,
stmmac_set_eee_pls(priv, priv->hw, true);
}
#ifdef CONFIG_MSM_BOOT_TIME_MARKER
if (phy->link == 1 && !priv->boot_kpi) {
if ((phy && phy->link == 1) && !priv->boot_kpi) {
place_marker("M - Ethernet is Ready.Link is UP");
priv->boot_kpi = true;
}