linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk/ti/adpll: Add a NULL check for devm_kasprintf()
@ 2020-05-18  3:46 Xu Wang
  2020-05-18  3:55 ` Joe Perches
  2020-05-27 12:20 ` kbuild test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Xu Wang @ 2020-05-18  3:46 UTC (permalink / raw)
  To: t-kristo, mturquette, sboyd, linux-omap, linux-clk; +Cc: linux-kernel

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-27 12:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2020-05-27 12:20 ` kbuild test robot

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).