drivers: soc: xilinx: check return status of get_api_version()
PATCH RESEND v2 1/1 drivers: soc: xilinx: check return status of get_api_version()
Currently return status is not getting checked for get_api_version and because of that for x86 arch we are getting below smatch error.
CC drivers/soc/xilinx/zynqmp_power.odrivers/soc/xilinx/zynqmp_power.c: In function 'zynqmp_pm_probe':drivers/soc/xilinx/zynqmp_power.c:295:12: warning: 'pm_api_version' is used uninitialized [-Wuninitialized]
295 | if (pm_api_version < ZYNQMP_PM_VERSION)
| ^
CHECK drivers/soc/xilinx/zynqmp_power.cdrivers/soc/xilinx/zynqmp_power.c:295 zynqmp_pm_probe() error:
uninitialized symbol 'pm_api_version'.
So, check return status of pm_get_api_version and return error in case of failure to avoid checking uninitialized pm_api_version variable.
---
V1: https://lore.kernel.org/lkml/[email protected]/V1->V2: Removed AMD copyright
--- drivers/soc/xilinx/zynqmp_power.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/soc/xilinx/zynqmp_power.c +3 -1
@@ -190,7 +190,9 @@ static int zynqmp_pm_probe(struct platform_device *pdev)u32 pm_api_version;struct mbox_client *client; -zynqmp_pm_get_api_version (&pm_api_version); + ret =zynqmp_pm_get_api_version (&pm_api_version); +if (ret) +return ret;/* Check PM API version number */ if (pm_api_version <ZYNQMP_PM_VERSION )
Signature · 1 line
2.17.1
Quoted 16 lines · Jay Buddhabhatti
Currently return status is not getting checked for
get_api_versionand because of that for x86 arch we are getting below smatch error.CC
drivers/soc/xilinx/zynqmp_power.odrivers/soc/xilinx/zynqmp_power.c: In function 'zynqmp_pm_probe':drivers/soc/xilinx/zynqmp_power.c:295:12: warning: 'pm_api_version' is used uninitialized [-Wuninitialized]
295 | if (pm_api_version<ZYNQMP_PM_VERSION)
| ^
CHECKdrivers/soc/xilinx/zynqmp_power.cdrivers/soc/xilinx/zynqmp_power.c:295zynqmp_pm_probe()error:
uninitialized symbol 'pm_api_version'.So, check return status of
pm_get_api_versionand return error in case of failure to avoid checking uninitializedpm_api_versionvariable.
Quoted 6 lines
Fixes b9b3a8be28b3 ("firmware: xilinx: Remove eemi ops for get_api_version")Signed-off-by Jay Buddhabhatti <[email protected]>---
V1: https://lore.kernel.org/lkml/[email protected]/V1->V2: Removed AMD copyright
---
Why is this a RESEND?
Also my bot had issues:
--------
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree.
You are receiving this message because of the following common error(s) as indicated below:
- You have marked a patch with a "Fixes:" tag for a commit that is in an older released kernel, yet you do not have a cc: stable line in the signed-off-by area at all, which means that the patch will not be applied to any older kernel releases. To properly fix this, please follow the documented rules in the Documentation/process/stable-kernel-rules.rst file for how to resolve this.
If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.
thanks,
greg k-h's patch email bot