From: Brian Masney <bmasney@redhat.com>
To: longlong yan <yanlonglong@kylinos.cn>
Cc: mturquette@baylibre.com, sboyd@kernel.org,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] clk/x86: pmc_atom: add kasprintf return value check
Date: Thu, 16 Jul 2026 10:31:08 -0400 [thread overview]
Message-ID: <aljrLM6kPRTiMGr7@redhat.com> (raw)
In-Reply-To: <20260714065133.487-1-yanlonglong@kylinos.cn>
On Tue, Jul 14, 2026 at 02:51:32PM +0800, longlong yan wrote:
> The kasprintf() function returns NULL on memory allocation failure, but
> the code in plt_clk_register() was not checking this return value. If
> kasprintf fails, init.name would be NULL and could cause NULL pointer
> dereference when clkdev_hw_create() uses it.
>
> Add proper error checking for the kasprintf() return value and return
> ERR_PTR(-ENOMEM) on failure.
>
> Fixes: 1141d9d08184 ("clk: x86: Add Atom PMC platform clocks")
> Signed-off-by: longlong yan <yanlonglong@kylinos.cn>
Reviewed-by: Brian Masney <bmasney@redhat.com>
prev parent reply other threads:[~2026-07-16 14:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-14 6:51 [PATCH] clk/x86: pmc_atom: add kasprintf return value check longlong yan
2026-07-16 14:31 ` Brian Masney [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=aljrLM6kPRTiMGr7@redhat.com \
--to=bmasney@redhat.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.org \
--cc=yanlonglong@kylinos.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.