From: Amelie Delaunay Date: Fri, 9 Jun 2023 09:28:03 +0000 (+0200) Subject: mfd: stmfx: Fix error path in stmfx_chip_init X-Git-Tag: v5.4.251~173 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=baec796723b7723e3b8bdb041399d10a8776a341;p=thirdparty%2Fkernel%2Fstable.git 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 Link: https://lore.kernel.org/r/20230609092804.793100-1-amelie.delaunay@foss.st.com Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- diff --git a/drivers/mfd/stmfx.c b/drivers/mfd/stmfx.c index 711979afd90a0..887c92342b7f1 100644 --- a/drivers/mfd/stmfx.c +++ b/drivers/mfd/stmfx.c @@ -389,7 +389,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; }