summaryrefslogtreecommitdiffstats
path: root/drivers/clocksource/timer-imx-gpt.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-08 04:21:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-08 04:21:35 +0000
commit7b642cd94bb96385cbdbb36a1952f129af6b1bbb (patch)
treee7c4209372da8a2fa745aaa3e99d062e54d0f556 /drivers/clocksource/timer-imx-gpt.c
parentAdding debian version 4.19.289-2. (diff)
downloadlinux-7b642cd94bb96385cbdbb36a1952f129af6b1bbb.tar.xz
linux-7b642cd94bb96385cbdbb36a1952f129af6b1bbb.zip
Merging upstream version 4.19.304.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/clocksource/timer-imx-gpt.c')
-rw-r--r--drivers/clocksource/timer-imx-gpt.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/clocksource/timer-imx-gpt.c b/drivers/clocksource/timer-imx-gpt.c
index 165fbbb1c..0e67026d7 100644
--- a/drivers/clocksource/timer-imx-gpt.c
+++ b/drivers/clocksource/timer-imx-gpt.c
@@ -473,12 +473,16 @@ static int __init mxc_timer_init_dt(struct device_node *np, enum imx_gpt_type t
return -ENOMEM;
imxtm->base = of_iomap(np, 0);
- if (!imxtm->base)
- return -ENXIO;
+ if (!imxtm->base) {
+ ret = -ENXIO;
+ goto err_kfree;
+ }
imxtm->irq = irq_of_parse_and_map(np, 0);
- if (imxtm->irq <= 0)
- return -EINVAL;
+ if (imxtm->irq <= 0) {
+ ret = -EINVAL;
+ goto err_kfree;
+ }
imxtm->clk_ipg = of_clk_get_by_name(np, "ipg");
@@ -491,11 +495,15 @@ static int __init mxc_timer_init_dt(struct device_node *np, enum imx_gpt_type t
ret = _mxc_timer_init(imxtm);
if (ret)
- return ret;
+ goto err_kfree;
initialized = 1;
return 0;
+
+err_kfree:
+ kfree(imxtm);
+ return ret;
}
static int __init imx1_timer_init_dt(struct device_node *np)