sxgbe_open() didn't check result of clk_prepare_enable() call. Add missing check Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 1edb9ca69e8a ("net: sxgbe: add basic framework for Samsung 10Gb ethernet driver") Signed-off-by: Pavel Zhigulin --- drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c index 75bad561b352..6b8e54391d7f 100644 --- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c +++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c @@ -1063,7 +1063,12 @@ static int sxgbe_open(struct net_device *dev) struct sxgbe_priv_data *priv = netdev_priv(dev); int ret, queue_num; - clk_prepare_enable(priv->sxgbe_clk); + ret = clk_prepare_enable(priv->sxgbe_clk); + if (ret < 0) { + netdev_err(dev, "%s: Cannot enable clock (error: %d)\n", + __func__, ret); + goto clk_error; + } sxgbe_check_ether_addr(priv); @@ -1195,6 +1200,7 @@ static int sxgbe_open(struct net_device *dev) phy_error: clk_disable_unprepare(priv->sxgbe_clk); +clk_error: return ret; } -- 2.43.0