mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Zhen Ni <zhen.ni@easystack.cn>,
	Thomas Gleixner <tglx@linutronix.de>,
	Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] clocksource: clps711x: Fix resource leaks in error paths
Date: Fri, 1 Aug 2025 16:00:09 +0200	[thread overview]
Message-ID: <60a236c2-0b36-4a2d-b0f2-40371b8c9236@web.de> (raw)
In-Reply-To: <20250731062331.1041773-1-zhen.ni@easystack.cn>

> 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

  reply	other threads:[~2025-08-01 14:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-31  6:23 Zhen Ni
2025-08-01 14:00 ` Markus Elfring [this message]
2025-08-04 12:36 ` [PATCH v2] " Zhen Ni
2025-08-04 12:52   ` Markus Elfring
     [not found]   ` <20250805035637.169422-1-zhen.ni@easystack.cn>
2025-08-13 12:14     ` [PATCH v3] " Daniel Lezcano
2025-08-14 12:33   ` Zhen Ni
2025-09-17 16:05     ` Daniel Lezcano
2025-09-19  3:54     ` [PATCH v4] " Zhen Ni

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=60a236c2-0b36-4a2d-b0f2-40371b8c9236@web.de \
    --to=markus.elfring@web.de \
    --cc=daniel.lezcano@linaro.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=zhen.ni@easystack.cn \
    /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®