Linux-OMAP Archive on lore.kernel.org
 help / color / Atom feed
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
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;


  reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18  3:46 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

Linux-OMAP Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-omap/0 linux-omap/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-omap linux-omap/ https://lore.kernel.org/linux-omap \
		linux-omap@vger.kernel.org
	public-inbox-index linux-omap

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-omap


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git