mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
pinctrl: zynqmp: Avoid using uninitialised variable
In zynqmp_pinconf_set if param is PIN_CFG_IOSTANDARD or PIN_CONFIG_POWER_SOURCE and zynqmp_pm_pinctrl_get_config returns an error then value will not be assigned to when its value is tested to be not equal to arg. Add code to only test value not equal to arg if ret is false. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Link: https://lore.kernel.org/r/20250807-pinctrl_misc-v1-4-eeb564a1b032@linaro.org Signed-off-by: Michal Simek <michal.simek@amd.com>
This commit is contained in:
committed by
Michal Simek
parent
7aac843944
commit
6ce599f513
@@ -460,14 +460,14 @@ static int zynqmp_pinconf_set(struct udevice *dev, unsigned int pin,
|
||||
case PIN_CFG_IOSTANDARD:
|
||||
param = PM_PINCTRL_CONFIG_VOLTAGE_STATUS;
|
||||
ret = zynqmp_pm_pinctrl_get_config(pin, param, &value);
|
||||
if (arg != value)
|
||||
if (!ret && arg != value)
|
||||
dev_warn(dev, "Invalid IO Standard requested for pin %d\n",
|
||||
pin);
|
||||
break;
|
||||
case PIN_CONFIG_POWER_SOURCE:
|
||||
param = PM_PINCTRL_CONFIG_VOLTAGE_STATUS;
|
||||
ret = zynqmp_pm_pinctrl_get_config(pin, param, &value);
|
||||
if (arg != value)
|
||||
if (!ret && arg != value)
|
||||
dev_warn(dev, "Invalid IO Standard requested for pin %d\n",
|
||||
pin);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user