summaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorAmelie Delaunay <amelie.delaunay@foss.st.com>2023-06-09 12:28:03 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-07-19 17:21:57 +0300
commit18abe5f4c3c6c3436c82382502c437505a7bd1ba (patch)
treefc5cab7776fae6acf8a0e15d842928c917cf9ef2 /drivers/mfd
parent5bd9dc3e767edf582be483be8d6bbc7433bd4cf8 (diff)
downloadlinux-18abe5f4c3c6c3436c82382502c437505a7bd1ba.tar.xz
mfd: stmfx: Fix error path in stmfx_chip_init
[ Upstream commit f592cf624531286f8b52e40dcfc157a5a7fb115c ] In error path, disable vdd regulator if it exists, but don't overload ret. Because if regulator_disable() is successful, stmfx_chip_init will exit successfully while chip init failed. Fixes: 06252ade9156 ("mfd: Add ST Multi-Function eXpander (STMFX) core driver") Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com> Link: https://lore.kernel.org/r/20230609092804.793100-1-amelie.delaunay@foss.st.com Signed-off-by: Lee Jones <lee@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/stmfx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mfd/stmfx.c b/drivers/mfd/stmfx.c
index 5dd7d9688459..61a8aad564a4 100644
--- a/drivers/mfd/stmfx.c
+++ b/drivers/mfd/stmfx.c
@@ -387,7 +387,7 @@ static int stmfx_chip_init(struct i2c_client *client)
err:
if (stmfx->vdd)
- return regulator_disable(stmfx->vdd);
+ regulator_disable(stmfx->vdd);
return ret;
}