]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: mux: demux-pinctrl: do not deactivate a master that is not active
authorPeter Rosin <peda@axentia.se>
Wed, 2 Mar 2022 11:22:35 +0000 (12:22 +0100)
committerWolfram Sang <wsa@kernel.org>
Sat, 19 Mar 2022 23:49:43 +0000 (00:49 +0100)
commitfeb6c8c5d66d96a448568378d8519a8677fceb06
treebed053014957e87778486e4e5dc3f5e7ccb66f81
parent7984509a73e25bb0578ad763cf2df70d83b61a35
i2c: mux: demux-pinctrl: do not deactivate a master that is not active

Attempting to rollback the activation of the current master when
the current master has not been activated is bad. priv->cur_chan
and priv->cur_adap are both still zeroed out and the rollback
may result in attempts to revert an of changeset that has not been
applied and do result in calls to both del and put the zeroed out
i2c_adapter. Maybe it crashes, or whatever, but it's bad in any
case.

Fixes: ef3253350f91 ("i2c: mux: demux-pinctrl: Fix an error handling path in 'i2c_demux_pinctrl_probe()'")
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/muxes/i2c-demux-pinctrl.c