[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <60a236c2-0b36-4a2d-b0f2-40371b8c9236@web.de>
Date: Fri, 1 Aug 2025 16:00:09 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Zhen Ni <zhen.ni@...ystack.cn>, Thomas Gleixner <tglx@...utronix.de>,
Daniel Lezcano <daniel.lezcano@...aro.org>
Cc: LKML <linux-kernel@...r.kernel.org>, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] clocksource: clps711x: Fix resource leaks in error paths
> The current implementation of clps711x_timer_init() has multiple error
> paths that directly return without releasing the base I/O memory mapped
How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.16#n145
> via of_iomap(). This leads to resource leaks when:
Please reconsider the need for the presented enumeration once more.
See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.16#n94
…
> +++ b/drivers/clocksource/clps711x-timer.c
> @@ -78,24 +78,34 @@ static int __init clps711x_timer_init(struct device_node *np)
…
> - return 0;
> +out:
> + if (base)
* I suggest to omit such a pointer check because it was performed already
directly after the of_iomap() call.
* Would it be nicer to use the label “unmap_io”?
> + iounmap(base);
> + return ret;
> }
> TIMER_OF_DECLARE(clps711x, "cirrus,ep7209-timer", clps711x_timer_init);
…
Regards,
Markus
Powered by blists - more mailing lists