[PATCH] clk/ti/adpll: Add a NULL check for devm_kasprintf()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Xu Wang <vulab@xxxxxxxxxxx>
---
 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




[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux