Skip to content

Commit 33ac515

Browse files
tititiou36Wolfram Sang
authored andcommitted
i2c: muxes: mule: Fix an error handling path in mule_i2c_mux_probe()
If an error occurs in the loop that creates the device adapters, then a reference to 'dev' still needs to be released. Use for_each_child_of_node_scoped() to both fix the issue and save one line of code. Fixes: d0f8e97 ("i2c: muxes: add support for tsd,mule-i2c multiplexer") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 0b7c952 commit 33ac515

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/i2c/muxes/i2c-mux-mule.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ static int mule_i2c_mux_probe(struct platform_device *pdev)
4747
struct mule_i2c_reg_mux *priv;
4848
struct i2c_client *client;
4949
struct i2c_mux_core *muxc;
50-
struct device_node *dev;
5150
unsigned int readback;
5251
int ndev, ret;
5352
bool old_fw;
@@ -95,7 +94,7 @@ static int mule_i2c_mux_probe(struct platform_device *pdev)
9594
"Failed to register mux remove\n");
9695

9796
/* Create device adapters */
98-
for_each_child_of_node(mux_dev->of_node, dev) {
97+
for_each_child_of_node_scoped(mux_dev->of_node, dev) {
9998
u32 reg;
10099

101100
ret = of_property_read_u32(dev, "reg", &reg);

0 commit comments

Comments
 (0)