Every call of of_parse_phandle() increments user count of found device
node, if OF_DYNAMIC is enabled.
The change fixes all similar addressed cases in drivers/i2c.
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
return -EINVAL;
}
arb->parent = of_get_i2c_adapter_by_node(parent_np);
+ of_node_put(parent_np);
if (!arb->parent) {
dev_err(dev, "Cannot find parent bus\n");
return -EPROBE_DEFER;
return -ENODEV;
}
adapter = of_find_i2c_adapter_by_node(adapter_np);
+ of_node_put(adapter_np);
if (!adapter)
return -EPROBE_DEFER;
return -ENODEV;
}
adapter = of_find_i2c_adapter_by_node(adapter_np);
+ of_node_put(adapter_np);
if (!adapter) {
dev_err(mux->dev, "Cannot find parent bus\n");
return -EPROBE_DEFER;
return -ENODEV;
}
adapter = of_find_i2c_adapter_by_node(adapter_np);
+ of_node_put(adapter_np);
if (!adapter)
return -EPROBE_DEFER;