clk: zynqmp: Check the return type zynqmp_pm_query_data
authorShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Wed, 6 Apr 2022 09:22:11 +0000 (14:52 +0530)
committerStephen Boyd <sboyd@kernel.org>
Tue, 23 Aug 2022 00:01:05 +0000 (17:01 -0700)
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>
drivers/clk/zynqmp/clkc.c

index 543e6e81712fb4456f737d228afcce7f6892d602..5636ff1ce552deb56fcc6251e5cb6c2aa6d55076 100644 (file)
@@ -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;