public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel•org>
To: linux-kernel@vger•kernel.org, stable@vger•kernel.org
Cc: Sasha Levin <sashal@kernel•org>,
	netdev@vger•kernel.org, Kangjie Lu <kjlu@umn•edu>,
	linux-stm32@st-md-mailman•stormreply.com,
	"David S . Miller" <davem@davemloft•net>,
	linux-arm-kernel@lists•infradead.org
Subject: [PATCH AUTOSEL 4.14 086/127] net: stmicro: fix a missing check of clk_prepare
Date: Fri, 22 Nov 2019 00:55:04 -0500	[thread overview]
Message-ID: <20191122055544.3299-85-sashal@kernel.org> (raw)
In-Reply-To: <20191122055544.3299-1-sashal@kernel.org>

From: Kangjie Lu <kjlu@umn•edu>

[ Upstream commit f86a3b83833e7cfe558ca4d70b64ebc48903efec ]

clk_prepare() could fail, so let's check its status, and if it fails,
return its error code upstream.

Signed-off-by: Kangjie Lu <kjlu@umn•edu>
Signed-off-by: David S. Miller <davem@davemloft•net>
Signed-off-by: Sasha Levin <sashal@kernel•org>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
index d07520fb969e6..62ccbd47c1db2 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
@@ -59,7 +59,9 @@ static int sun7i_gmac_init(struct platform_device *pdev, void *priv)
 		gmac->clk_enabled = 1;
 	} else {
 		clk_set_rate(gmac->tx_clk, SUN7I_GMAC_MII_RATE);
-		clk_prepare(gmac->tx_clk);
+		ret = clk_prepare(gmac->tx_clk);
+		if (ret)
+			return ret;
 	}
 
 	return 0;
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      parent reply	other threads:[~2019-11-22  6:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191122055544.3299-1-sashal@kernel.org>
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 005/127] ARM: dts: imx53-voipac-dmm-668: Fix memory node duplication Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 008/127] arm64: mm: Prevent mismatched 52-bit VA support Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 009/127] arm64: smp: Handle errors reported by the firmware Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 010/127] ARM: OMAP1: fix USB configuration for device-only setups Sasha Levin
2019-11-22  5:53 ` [PATCH AUTOSEL 4.14 013/127] ARM: ks8695: fix section mismatch warning Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 029/127] mmc: meson-gx: make sure the descriptor is stopped on errors Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 030/127] mtd: rawnand: sunxi: Write pageprog related opcodes to WCMD_SET Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 079/127] MIPS: BCM63XX: fix switch core reset on BCM6368 Sasha Levin
2019-11-22  5:54 ` [PATCH AUTOSEL 4.14 080/127] pwm: clps711x: Fix period calculation Sasha Levin
2019-11-22  5:55 ` Sasha Levin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191122055544.3299-85-sashal@kernel.org \
    --to=sashal@kernel$(echo .)org \
    --cc=davem@davemloft$(echo .)net \
    --cc=kjlu@umn$(echo .)edu \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-stm32@st-md-mailman$(echo .)stormreply.com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=stable@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox