firmware: xilinx: check return value of zynqmp_pm_get_api_version()
authorRajan Vaja <rajan.vaja@xilinx.com>
Wed, 6 Oct 2021 08:43:55 +0000 (01:43 -0700)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 8 Dec 2021 11:53:36 +0000 (12:53 +0100)
Currently return value of zynqmp_pm_get_api_version() is ignored.
Because of that, API version is checked in case of error also.
So add check for return value of zynqmp_pm_get_api_version().

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/1633509835-31949-1-git-send-email-rajan.vaja@xilinx.com
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/firmware/xilinx/zynqmp.c

index 3dd45a7..0dd1178 100644 (file)
@@ -1434,7 +1434,10 @@ static int zynqmp_firmware_probe(struct platform_device *pdev)
                return ret;
 
        /* Check PM API version number */
-       zynqmp_pm_get_api_version(&pm_api_version);
+       ret = zynqmp_pm_get_api_version(&pm_api_version);
+       if (ret)
+               return ret;
+
        if (pm_api_version < ZYNQMP_PM_VERSION) {
                panic("%s Platform Management API version error. Expected: v%d.%d - Found: v%d.%d\n",
                      __func__,