linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mdio: mux: fix device_node_continue.cocci warnings
@ 2017-05-12 14:54 Julia Lawall
  2017-05-12 16:22 ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Julia Lawall @ 2017-05-12 14:54 UTC (permalink / raw)
  To: netdev, Jon Mason; +Cc: Andrew Lunn, Florian Fainelli, kbuild-all, linux-kernel

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>
---

tree:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
master
head:   8785ded64cfb68b8d8b2583c7c1fc611f99eabf2
commit: b60161668199ac62011c024adc9e66713b9554e7 [13999/14120] mdio: mux:

 mdio-mux.c |    1 -
 1 file changed, 1 deletion(-)

--- 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;

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-05-15 18:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-12 14:54 [PATCH] mdio: mux: fix device_node_continue.cocci warnings Julia Lawall
2017-05-12 16:22 ` David Miller
2017-05-12 22:52   ` Florian Fainelli
2017-05-13  0:40     ` Julia Lawall
2017-05-15 17:37     ` Jon Mason
2017-05-15 18:29       ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).