Skip to content

Commit acc1c73

Browse files
Shubhrajyoti Dattabebarino
authored andcommitted
clk: zynqmp: Replaced strncpy() with strscpy()
Replaced strncpy() with strscpy() as the clock names are supposed to be NULL terminated. Signed-off-by: Shubhrajyoti Datta <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Michal Simek <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent dd80fb2 commit acc1c73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/clk/zynqmp/clkc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static int zynqmp_get_clock_name(u32 clk_id, char *clk_name)
163163

164164
ret = zynqmp_is_valid_clock(clk_id);
165165
if (ret == 1) {
166-
strncpy(clk_name, clock[clk_id].clk_name, MAX_NAME_LEN);
166+
strscpy(clk_name, clock[clk_id].clk_name, MAX_NAME_LEN);
167167
return 0;
168168
}
169169

@@ -719,7 +719,7 @@ static void zynqmp_get_clock_info(void)
719719

720720
if (!strcmp(name.name, RESERVED_CLK_NAME))
721721
continue;
722-
strncpy(clock[i].clk_name, name.name, MAX_NAME_LEN);
722+
strscpy(clock[i].clk_name, name.name, MAX_NAME_LEN);
723723
}
724724

725725
/* Get topology of all clock */

0 commit comments

Comments
 (0)