Skip to content

Commit 9b003e1

Browse files
jbuddhabmichalsimek
authored andcommitted
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.o drivers/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.c drivers/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. Fixes: b9b3a8b ("firmware: xilinx: Remove eemi ops for get_api_version") Signed-off-by: Jay Buddhabhatti <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]>
1 parent 494c55a commit 9b003e1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/soc/xilinx/zynqmp_power.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ static int zynqmp_pm_probe(struct platform_device *pdev)
288288
u32 pm_api_version, pm_family_code, pm_sub_family_code, node_id;
289289
struct mbox_client *client;
290290

291-
zynqmp_pm_get_api_version(&pm_api_version);
291+
ret = zynqmp_pm_get_api_version(&pm_api_version);
292+
if (ret)
293+
return ret;
292294

293295
/* Check PM API version number */
294296
if (pm_api_version < ZYNQMP_PM_VERSION)

0 commit comments

Comments
 (0)