mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 08:02:27 +02:00
platform/x86/siemens: simatic-ipc-batt: fix wrong pointer pass to PTR_ERR()
Fix wrong pointer pass to PTR_ERR() if devm_gpiod_get_index() fails.
Fixes: 917f543407 ("platform/x86: simatic-ipc: add CMOS battery monitoring")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230809081227.1221267-1-yangyingliang@huawei.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
c56beff203
commit
e5d5ffa48a
|
|
@ -198,7 +198,7 @@ int simatic_ipc_batt_probe(struct platform_device *pdev, struct gpiod_lookup_tab
|
|||
flags = GPIOD_OUT_LOW;
|
||||
priv.gpios[2] = devm_gpiod_get_index(dev, "CMOSBattery meter", 2, flags);
|
||||
if (IS_ERR(priv.gpios[2])) {
|
||||
err = PTR_ERR(priv.gpios[1]);
|
||||
err = PTR_ERR(priv.gpios[2]);
|
||||
priv.gpios[2] = NULL;
|
||||
goto out;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user