summaryrefslogtreecommitdiffstats
path: root/drivers/clk/zynqmp
diff options
context:
space:
mode:
authorShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>2022-04-06 11:22:11 +0200
committerStephen Boyd <sboyd@kernel.org>2022-08-23 02:01:05 +0200
commit8bdb15cd05d4365dfb75978d885328ebdeb5875e (patch)
tree081bbc1c50a7b66f3bf912231afcd05cbc2096bd /drivers/clk/zynqmp
parentclk: zynqmp: Add a check for NULL pointer (diff)
downloadlinux-8bdb15cd05d4365dfb75978d885328ebdeb5875e.tar.xz
linux-8bdb15cd05d4365dfb75978d885328ebdeb5875e.zip
clk: zynqmp: Check the return type zynqmp_pm_query_data
Check the return type of zynqmp_pm_query_data(qdata, ret_payload); Addresses-Coverity: Event check_return Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Link: https://lore.kernel.org/r/20220406092211.19017-1-shubhrajyoti.datta@xilinx.com Acked-by: Michal Simek <michal.simek@amd.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/zynqmp')
-rw-r--r--drivers/clk/zynqmp/clkc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/clk/zynqmp/clkc.c b/drivers/clk/zynqmp/clkc.c
index 543e6e81712f..5636ff1ce552 100644
--- a/drivers/clk/zynqmp/clkc.c
+++ b/drivers/clk/zynqmp/clkc.c
@@ -220,18 +220,22 @@ static int zynqmp_pm_clock_get_num_clocks(u32 *nclocks)
* This function is used to get name of clock specified by given
* clock ID.
*
- * Return: Returns 0
+ * Return: 0 on success else error+reason
*/
static int zynqmp_pm_clock_get_name(u32 clock_id,
struct name_resp *response)
{
struct zynqmp_pm_query_data qdata = {0};
u32 ret_payload[PAYLOAD_ARG_CNT];
+ int ret;
qdata.qid = PM_QID_CLOCK_GET_NAME;
qdata.arg1 = clock_id;
- zynqmp_pm_query_data(qdata, ret_payload);
+ ret = zynqmp_pm_query_data(qdata, ret_payload);
+ if (ret)
+ return ret;
+
memcpy(response, ret_payload, sizeof(*response));
return 0;