diff options
author | Rajan Vaja <rajan.vaja@xilinx.com> | 2021-10-06 11:43:55 +0300 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2021-12-08 14:53:36 +0300 |
commit | 168e05c131cd15932f95364b103b8cb7dbf19546 (patch) | |
tree | b37fdc1feed3676b09531fa150e87b25f709d6cc /drivers/firmware/xilinx/zynqmp.c | |
parent | 628e8ba1d331397d580e65a61c0fb4b5ae8e5ccb (diff) | |
download | linux-168e05c131cd15932f95364b103b8cb7dbf19546.tar.xz |
firmware: xilinx: check return value of zynqmp_pm_get_api_version()
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>
Diffstat (limited to 'drivers/firmware/xilinx/zynqmp.c')
-rw-r--r-- | drivers/firmware/xilinx/zynqmp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 3dd45a7420dc..0dd117860b63 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -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__, |