firmware: xilinx: check return value of zynqmp_pm_get_api_version()
PATCH 1/1 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().
--- drivers/firmware/xilinx/zynqmp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/firmware/xilinx/zynqmp.c +4 -1
@@ -1371,7 +1371,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__,
Signature · 1 line
2.7.4
Quoted 16 lines · Rajan Vaja
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 ofzynqmp_pm_get_api_version().Signed-off-by Rajan Vaja <[email protected]>--- drivers/firmware/xilinx/zynqmp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/firmware/xilinx/zynqmp.c +0
-0@@ -1371,7 +1371,10 @@ static int zynqmp_firmware_probe(struct platform_device *pdev)return ret;
drivers/firmware/xilinx/zynqmp.c static int zynqmp_firmware_probe(struct platform_device *pdev) · line 1380
Quoted 10 lines
drivers/firmware/xilinx/zynqmp.c +4
-1/* 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__,
Thanks,
Michal
Michal Simek
AppliedQuoted 16 lines · Rajan Vaja
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 ofzynqmp_pm_get_api_version().Signed-off-by Rajan Vaja <[email protected]>--- drivers/firmware/xilinx/zynqmp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/firmware/xilinx/zynqmp.c +0
-0@@ -1371,7 +1371,10 @@ static int zynqmp_firmware_probe(struct platform_device *pdev)return ret;
drivers/firmware/xilinx/zynqmp.c static int zynqmp_firmware_probe(struct platform_device *pdev) · line 1380
Quoted 10 lines
drivers/firmware/xilinx/zynqmp.c +4
-1/* 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__,
Applied.
M