Commit 214b3369 authored by Tom Rix's avatar Tom Rix Committed by David S. Miller

net: ethernet: mtk_eth_soc: fix error checking in mtk_mac_config()

Clang static analysis reports this problem
mtk_eth_soc.c:394:7: warning: Branch condition evaluates
  to a garbage value
                if (err)
                    ^~~

err is not initialized and only conditionally set.
So intitialize err.

Fixes: 7e538372 ("net: ethernet: mediatek: Re-add support SGMII")
Signed-off-by: default avatarTom Rix <trix@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 80f15f3b
...@@ -267,7 +267,7 @@ static void mtk_mac_config(struct phylink_config *config, unsigned int mode, ...@@ -267,7 +267,7 @@ static void mtk_mac_config(struct phylink_config *config, unsigned int mode,
phylink_config); phylink_config);
struct mtk_eth *eth = mac->hw; struct mtk_eth *eth = mac->hw;
u32 mcr_cur, mcr_new, sid, i; u32 mcr_cur, mcr_new, sid, i;
int val, ge_mode, err; int val, ge_mode, err = 0;
/* MT76x8 has no hardware settings between for the MAC */ /* MT76x8 has no hardware settings between for the MAC */
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628) && if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment