From: Joe Perches <joe@perches.com>
To: Xu Wang <vulab@iscas.ac.cn>,
t-kristo@ti.com, mturquette@baylibre.com, sboyd@kernel.org,
linux-omap@vger.kernel.org, linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] clk/ti/adpll: Add a NULL check for devm_kasprintf()
Date: Sun, 17 May 2020 20:55:30 -0700 [thread overview]
Message-ID: <b8a08623cc0f858e0f961240a0cf610d32c6816d.camel@perches.com> (raw)
In-Reply-To: <1589773618-3658-1-git-send-email-vulab@iscas.ac.cn>
On Mon, 2020-05-18 at 03:46 +0000, Xu Wang wrote:
> devm_kasprintf() may fail, so we should better add a NULL check
> and propagate an error on failure.
You didn't compile this.
All the return values of this function are already checked.
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
> ---
> drivers/clk/ti/adpll.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/clk/ti/adpll.c b/drivers/clk/ti/adpll.c
> index bb2f283..f18a672 100644
> --- a/drivers/clk/ti/adpll.c
> +++ b/drivers/clk/ti/adpll.c
> @@ -196,6 +196,8 @@ static const char *ti_adpll_clk_get_name(struct ti_adpll_data *d,
> } else {
> name = devm_kasprintf(d->dev, GFP_KERNEL, "%08lx.adpll.%s",
> d->pa, postfix);
> + if (!name)
> + return -ENOMEM;
> }
>
> return name;
next prev parent reply other threads:[~2020-05-18 3:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-18 3:46 [PATCH] clk/ti/adpll: Add a NULL check for devm_kasprintf() Xu Wang
2020-05-18 3:55 ` Joe Perches [this message]
2020-05-27 12:20 ` kbuild test robot
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=b8a08623cc0f858e0f961240a0cf610d32c6816d.camel@perches.com \
--to=joe@perches.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.org \
--cc=t-kristo@ti.com \
--cc=vulab@iscas.ac.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;
as well as URLs for NNTP newsgroup(s).