[linux-yocto] [PATCH 5/7] clkdev: fix clk_add_alias() with a NULL alias device name

Yong, Jonathan jonathan.yong at intel.com
Tue Feb 23 16:10:11 PST 2016

From: Russell King <rmk+kernel at arm.linux.org.uk>

clk_add_alias() was not correctly handling the case where alias_dev_name
was NULL: rather than producing an entry with a NULL dev_id pointer,
it would produce a device name of (null).  Fix this.

Cc: <stable at vger.kernel.org>
Fixes: 2568999835d7 ("clkdev: add clkdev_create() helper")
Reported-by: Aaro Koskinen <aaro.koskinen at iki.fi>
Tested-by: Aaro Koskinen <aaro.koskinen at iki.fi>
Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
(cherry picked from commit 625faa6a720d26fc0db9e20b48dc0dfe4c8d8ddf)
Signed-off-by: Yong, Jonathan <jonathan.yong at intel.com>
 drivers/clk/clkdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
index c0eaf09..779b6ff 100644
--- a/drivers/clk/clkdev.c
+++ b/drivers/clk/clkdev.c
@@ -333,7 +333,8 @@ int clk_add_alias(const char *alias, const char *alias_dev_name,
 	if (IS_ERR(r))
 		return PTR_ERR(r);
-	l = clkdev_create(r, alias, "%s", alias_dev_name);
+	l = clkdev_create(r, alias, alias_dev_name ? "%s" : NULL,
+			  alias_dev_name);
 	return l ? 0 : -ENODEV;

More information about the linux-yocto mailing list