Skip to content

Commit 625faa6

Browse files
author
Russell King
committed
clkdev: fix clk_add_alias() with a NULL alias device name
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@vger.kernel.org> Fixes: 2568999 ("clkdev: add clkdev_create() helper") Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent 8a603f9 commit 625faa6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/clk/clkdev.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,8 @@ int clk_add_alias(const char *alias, const char *alias_dev_name,
333333
if (IS_ERR(r))
334334
return PTR_ERR(r);
335335

336-
l = clkdev_create(r, alias, "%s", alias_dev_name);
336+
l = clkdev_create(r, alias, alias_dev_name ? "%s" : NULL,
337+
alias_dev_name);
337338
clk_put(r);
338339

339340
return l ? 0 : -ENODEV;

0 commit comments

Comments
 (0)