mdio: mux: fix device_node_continue.cocci warnings
authorJulia Lawall <julia.lawall@lip6.fr>
Fri, 12 May 2017 14:54:23 +0000 (22:54 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Apr 2018 17:47:57 +0000 (19:47 +0200)
commit6c9b7010fba9585ad21d26a7eeaca666be3008d8
treea47ac758d7ec4b5c7572ac34f03e5c74472e3d1e
parentbffb84bf5a63288a65cbdbd0be860b780322f857
mdio: mux: fix device_node_continue.cocci warnings

[ Upstream commit 8c977f5a856a7276450ddf3a7b57b4a8815b63f9 ]

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: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/phy/mdio-mux.c