From: Sasha Levin <Alexander.Levin@microsoft.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: Branislav Radocaj <branislav@radocaj.org>,
"David S . Miller" <davem@davemloft.net>,
Sasha Levin <Alexander.Levin@microsoft.com>
Subject: [PATCH AUTOSEL for 4.9 29/49] net: ethernet: arc: fix error handling in emac_rockchip_probe
Date: Sun, 28 Jan 2018 22:27:54 +0000 [thread overview]
Message-ID: <20180128222727.22404-29-alexander.levin@microsoft.com> (raw)
In-Reply-To: <20180128222727.22404-1-alexander.levin@microsoft.com>
From: Branislav Radocaj <branislav@radocaj.org>
[ Upstream commit e46772a6946a7d1f3fbbc1415871851d6651f1d4 ]
If clk_set_rate() fails, we should disable clk before return.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Branislav Radocaj <branislav@radocaj.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
drivers/net/ethernet/arc/emac_rockchip.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/arc/emac_rockchip.c b/drivers/net/ethernet/arc/emac_rockchip.c
index e278e3d96ee0..c6163874e4e7 100644
--- a/drivers/net/ethernet/arc/emac_rockchip.c
+++ b/drivers/net/ethernet/arc/emac_rockchip.c
@@ -220,9 +220,11 @@ static int emac_rockchip_probe(struct platform_device *pdev)
/* RMII TX/RX needs always a rate of 25MHz */
err = clk_set_rate(priv->macclk, 25000000);
- if (err)
+ if (err) {
dev_err(dev,
"failed to change mac clock rate (%d)\n", err);
+ goto out_clk_disable_macclk;
+ }
}
err = arc_emac_probe(ndev, interface);
@@ -232,7 +234,8 @@ static int emac_rockchip_probe(struct platform_device *pdev)
}
return 0;
-
+out_clk_disable_macclk:
+ clk_disable_unprepare(priv->macclk);
out_regulator_disable:
if (priv->regulator)
regulator_disable(priv->regulator);
--
2.11.0
next prev parent reply other threads:[~2018-01-28 22:29 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-28 22:27 [PATCH AUTOSEL for 4.9 01/49] usb: build drivers/usb/common/ when USB_SUPPORT is set Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 02/49] ARM: OMAP2+: Fix SRAM virt to phys translation for save_secure_ram_context Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 03/49] ARM: AM33xx: PRM: Remove am33xx_pwrdm_read_prev_pwrst function Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 04/49] ARM: dts: Fix omap4 hang with GPS connected to USB by using wakeupgen Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 05/49] ARM: dts: logicpd-som-lv: Fix gpmc addresses for NAND and enet Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 06/49] ARM: dts: logicpd-somlv: Fix wl127x pinmux Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 07/49] ARM: dts: am4372: Correct the interrupts_properties of McASP Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 08/49] ARM: dts: am437x-cm-t43: Correct the dmas property of spi0 Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 09/49] perf top: Fix window dimensions change handling Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 11/49] media: s5k6aa: describe some function parameters Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 10/49] perf bench numa: Fixup discontiguous/sparse numa nodes Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 12/49] pinctrl: sunxi: Fix A80 interrupt pin bank Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 14/49] i40iw: Correct ARP index mask Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 13/49] pinctrl: sunxi: Fix A64 UART mux value Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 15/49] RDMA/cma: Make sure that PSN is not over max allowed Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 17/49] scripts/kernel-doc: Don't fail with status != 0 if error encountered with -none Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 16/49] sctp: only update outstanding_bytes for transmitted queue when doing prsctp_prune Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 18/49] ipvlan: Add the skb->mark as flow4's member to lookup route Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 19/49] m68k: add missing SOFTIRQENTRY_TEXT linker section Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 20/49] powerpc/perf: Fix oops when grouping different pmu events Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 21/49] s390/dasd: prevent prefix I/O error Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 22/49] ARM: dts: Fix elm interrupt compiler warning Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 23/49] gianfar: fix a flooded alignment reports because of padding issue Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 24/49] net_sched: red: Avoid devision by zero Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 25/49] net_sched: red: Avoid illegal values Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 26/49] dccp: CVE-2017-8824: use-after-free in DCCP code Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 27/49] btrfs: Fix possible off-by-one in btrfs_search_path_in_tree Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 28/49] brcmfmac: Avoid build error with make W=1 Sasha Levin
2018-01-28 22:27 ` Sasha Levin [this message]
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 30/49] 509: fix printing uninitialized stack memory when OID is empty Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 32/49] dmaengine: ioat: Fix error handling path Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 31/49] gianfar: Disable EEE autoneg by default Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 33/49] dmaengine: at_hdmac: fix potential NULL pointer dereference in atc_prep_dma_interleaved Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 34/49] xfrm: Fix stack-out-of-bounds read on socket policy lookup Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 35/49] netfilter: nfnetlink_cthelper: Add missing permission checks Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 36/49] clk: fix a panic error caused by accessing NULL pointer Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 37/49] netfilter: xt_osf: Add missing permission checks Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 38/49] ASoC: rockchip: disable clock on error Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 39/49] spi: sun4i: disable clocks in the remove function Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 40/49] xfrm: Fix stack-out-of-bounds with misconfigured transport mode policies Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 41/49] drm/armada: fix leak of crtc structure Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 42/49] dmaengine: jz4740: disable/unprepare clk if probe fails Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 43/49] usb: dwc3: gadget: Wait longer for controller to end command processing Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 44/49] usb: dwc3: of-simple: fix missing clk_disable_unprepare Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 45/49] mm/early_ioremap: Fix boot hang with earlyprintk=efi,keep Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 46/49] x86/mm/kmmio: Fix mmiotrace for page unaligned addresses Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 48/49] xen: XEN_ACPI_PROCESSOR is Dom0-only Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 47/49] platform/x86: dell-laptop: Fix keyboard max lighting for Dell Latitude E6410 Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 49/49] hippi: Fix a Fix a possible sleep-in-atomic bug in rr_close Sasha Levin
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=20180128222727.22404-29-alexander.levin@microsoft.com \
--to=alexander.levin@microsoft.com \
--cc=branislav@radocaj.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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
all inboxes | Powered by JetHome®