Skip to content

Commit ba35cc0

Browse files
tititiou36gregkh
authored andcommitted
i2c: omap: Fix an error handling path in omap_i2c_probe()
commit 666c23a upstream. If an error occurs after calling mux_state_select(), mux_state_deselect() should be called as already done in the remove function. Fixes: b6ef830 ("i2c: omap: Add support for setting mux") Signed-off-by: Christophe JAILLET <[email protected]> Cc: <[email protected]> # v6.15+ Signed-off-by: Andi Shyti <[email protected]> Link: https://lore.kernel.org/r/998542981b6d2435c057dd8b9fe71743927babab.1749913149.git.christophe.jaillet@wanadoo.fr Stable-dep-of: a9503a2 ("i2c: omap: Handle omap_i2c_init() errors in omap_i2c_probe()") Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c1a786f commit ba35cc0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/i2c/busses/i2c-omap.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,13 +1461,13 @@ omap_i2c_probe(struct platform_device *pdev)
14611461
if (IS_ERR(mux_state)) {
14621462
r = PTR_ERR(mux_state);
14631463
dev_dbg(&pdev->dev, "failed to get I2C mux: %d\n", r);
1464-
goto err_disable_pm;
1464+
goto err_put_pm;
14651465
}
14661466
omap->mux_state = mux_state;
14671467
r = mux_state_select(omap->mux_state);
14681468
if (r) {
14691469
dev_err(&pdev->dev, "failed to select I2C mux: %d\n", r);
1470-
goto err_disable_pm;
1470+
goto err_put_pm;
14711471
}
14721472
}
14731473

@@ -1515,6 +1515,9 @@ omap_i2c_probe(struct platform_device *pdev)
15151515

15161516
err_unuse_clocks:
15171517
omap_i2c_write_reg(omap, OMAP_I2C_CON_REG, 0);
1518+
if (omap->mux_state)
1519+
mux_state_deselect(omap->mux_state);
1520+
err_put_pm:
15181521
pm_runtime_dont_use_autosuspend(omap->dev);
15191522
pm_runtime_put_sync(omap->dev);
15201523
err_disable_pm:

0 commit comments

Comments
 (0)