net: ethernet: mtk_eth_soc: fix error checking in mtk_mac_config()
authorTom Rix <trix@redhat.com>
Sat, 15 Jan 2022 17:49:18 +0000 (09:49 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:05:40 +0000 (11:05 +0100)
commitf8df88d6d10cdc728c6c9a5036a91e0339638188
tree204ee29c3e14c5caf702a75a49b884930e37d7f5
parentc2d55304dba82b4852883012b785c97d1a884c9b
net: ethernet: mtk_eth_soc: fix error checking in mtk_mac_config()

commit 214b3369ab9b0a6f28d6c970220c209417edbc65 upstream.

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: 7e538372694b ("net: ethernet: mediatek: Re-add support SGMII")
Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mediatek/mtk_eth_soc.c