mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xu Wang <vulab@iscas.ac.cn>
To: 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: [PATCH] clk/ti/adpll: Add a NULL check for devm_kasprintf()
Date: Mon, 18 May 2020 03:46:58 +0000	[thread overview]
Message-ID: <1589773618-3658-1-git-send-email-vulab@iscas.ac.cn> (raw)

devm_kasprintf() may fail, so we should better add a NULL check
and propagate an error on failure.

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;
-- 
2.7.4


             reply	other threads:[~2020-05-18  3:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18  3:46 Xu Wang [this message]
2020-05-18  3:55 ` Joe Perches
2020-05-18  5:02 ` kbuild test robot
2020-05-18  5:47 ` kbuild test robot
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=1589773618-3658-1-git-send-email-vulab@iscas.ac.cn \
    --to=vulab@iscas.ac.cn \
    --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 \
    /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®