Commit f2afaad0 authored by Siva Durga Prasad Paladugu's avatar Siva Durga Prasad Paladugu Committed by Manish Pandey
Browse files

zynqmp: pm_api_clock: Copy only the valid bytes



This patches copies only the valid part of string and
avoids filling junk at the end.
Signed-off-by: default avatarSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: default avatarRajan Vaja <rajan.vaja@xilinx.com>
Change-Id: If23772f31f9cf7f5042e8bfc474fbfe77dcd90e7
parent 77990838
/*
* Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2018-2020, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
......@@ -2435,7 +2435,8 @@ enum pm_ret_status pm_api_clock_get_num_clocks(unsigned int *nclocks)
enum pm_ret_status pm_api_clock_get_name(unsigned int clock_id, char *name)
{
if (clock_id == CLK_MAX)
memcpy(name, END_OF_CLK, CLK_NAME_LEN);
memcpy(name, END_OF_CLK, sizeof(END_OF_CLK) > CLK_NAME_LEN ?
CLK_NAME_LEN : sizeof(END_OF_CLK));
else if (!pm_clock_valid(clock_id))
memset(name, 0, CLK_NAME_LEN);
else if (clock_id < CLK_MAX_OUTPUT_CLK)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment