Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1640520

[PATCH] mdio: mux: fix device_node_continue.cocci warnings

From Julia Lawall <julia.lawall@lip6.fr>
Newsgroups linux.kernel
Subject [PATCH] mdio: mux: fix device_node_continue.cocci warnings
Date 2017-05-12 17:00 +0200
Message-ID <tGkcW-62A-9@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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;

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] mdio: mux: fix device_node_continue.cocci warnings Julia Lawall <julia.lawall@lip6.fr> - 2017-05-12 17:00 +0200
  Re: [PATCH] mdio: mux: fix device_node_continue.cocci warnings David Miller <davem@davemloft.net> - 2017-05-12 18:30 +0200
    Re: [PATCH] mdio: mux: fix device_node_continue.cocci warnings Florian Fainelli <f.fainelli@gmail.com> - 2017-05-13 01:00 +0200
      Re: [PATCH] mdio: mux: fix device_node_continue.cocci warnings Julia Lawall <julia.lawall@lip6.fr> - 2017-05-13 02:50 +0200
      Re: [PATCH] mdio: mux: fix device_node_continue.cocci warnings Jon Mason <jon.mason@broadcom.com> - 2017-05-15 19:40 +0200
        Re: [PATCH] mdio: mux: fix device_node_continue.cocci warnings David Miller <davem@davemloft.net> - 2017-05-15 20:30 +0200

csiph-web