[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b8a08623cc0f858e0f961240a0cf610d32c6816d.camel@perches.com>
Date: Sun, 17 May 2020 20:55:30 -0700
From: Joe Perches <joe@...ches.com>
To: Xu Wang <vulab@...as.ac.cn>, t-kristo@...com,
mturquette@...libre.com, sboyd@...nel.org,
linux-omap@...r.kernel.org, linux-clk@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] clk/ti/adpll: Add a NULL check for devm_kasprintf()
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@...as.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;
Powered by blists - more mailing lists