From: Markus Elfring <Markus.Elfring@web.de>
To: Henry Martin <bsdhenrymartin@gmail.com>,
linux-perf-users@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Cc: LKML <linux-kernel@vger.kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Will Deacon <will@kernel.org>
Subject: Re: [PATCH v2] driver: tx2: Add NULL check in tx2_uncore_pmu_register
Date: Mon, 31 Mar 2025 16:32:36 +0200 [thread overview]
Message-ID: <e617d125-0d04-4f18-9fa4-b0e97564fa85@web.de> (raw)
In-Reply-To: <20250331135128.11881-1-bsdhenrymartin@gmail.com>
…
> +++ b/drivers/perf/thunderx2_pmu.c
> @@ -738,7 +738,8 @@ static int tx2_uncore_pmu_register(
>
> tx2_pmu->pmu.name = devm_kasprintf(dev, GFP_KERNEL,
> "%s", name);
> -
> + if (!tx2_pmu->pmu.name)
> + return -ENOMEM;
> return perf_pmu_register(&tx2_pmu->pmu, tx2_pmu->pmu.name, -1);
> }
…
Should source code analysis approaches take further implementation details
better into account?
Example:
perf_pmu_register()
https://elixir.bootlin.com/linux/v6.14-rc6/source/kernel/events/core.c#L11859-L11862
…
if (WARN_ONCE(!name, "Can not register anonymous pmu.\n")) {
ret = -EINVAL;
…
Regards,
Markus
prev parent reply other threads:[~2025-03-31 14:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-31 13:51 Henry Martin
2025-03-31 14:07 ` Markus Elfring
2025-03-31 14:32 ` Markus Elfring [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=e617d125-0d04-4f18-9fa4-b0e97564fa85@web.de \
--to=markus.elfring@web.de \
--cc=bsdhenrymartin@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=will@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®