From: Julia Lawall Date: Fri, 12 May 2017 14:54:23 +0000 (+0800) Subject: mdio: mux: fix device_node_continue.cocci warnings X-Git-Tag: MMI-PSA29.97-13-9~5583^2~5 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8c977f5a856a7276450ddf3a7b57b4a8815b63f9;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Signed-off-by: Julia Lawall Signed-off-by: Fengguang Wu Signed-off-by: David S. Miller --- diff --git a/drivers/net/phy/mdio-mux.c b/drivers/net/phy/mdio-mux.c index 6943c5ece44a..599ce24c514f 100644 --- a/drivers/net/phy/mdio-mux.c +++ b/drivers/net/phy/mdio-mux.c @@ -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;