Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c977f5a authored by Julia Lawall's avatar Julia Lawall Committed by David S. Miller
Browse files

mdio: mux: fix device_node_continue.cocci warnings



Device node iterators put the previous value of the index variable, so an
explicit put causes a double put.

In particular, of_mdiobus_register can fail before doing anything
interesting, so one could view it as a no-op from the reference count
point of view.

Generated by: scripts/coccinelle/iterators/device_node_continue.cocci

CC: Jon Mason <jon.mason@broadcom.com>
Signed-off-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
Signed-off-by: default avatarFengguang Wu <fengguang.wu@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d19b183c
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -169,7 +169,6 @@ int mdio_mux_init(struct device *dev,
		if (r) {
			mdiobus_free(cb->mii_bus);
			devm_kfree(dev, cb);
			of_node_put(child_bus_node);
		} else {
			cb->next = pb->children;
			pb->children = cb;