]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "net: eth: cpsw: Correctly attach to GPIO bitbang MDIO driver"
authorJohan Hovold <jhovold@gmail.com>
Thu, 8 May 2014 08:09:22 +0000 (10:09 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 May 2014 19:51:20 +0000 (15:51 -0400)
commit6940f03ca135e8d3ae198b9408a2d9a2f8041422
treef114ff17481a94335821d1b0e6afa4488d5f3a44
parentd7e33b72701fc491d97e1038aab9bdd9ad781998
Revert "net: eth: cpsw: Correctly attach to GPIO bitbang MDIO driver"

This reverts commit 705a89c20a4d6335d6e0f5732e4b43474e4b9bae ("net:
 eth: cpsw: Correctly attach to GPIO bitbang MDIO driver").

Fix potential null-pointer dereference at probe if the mdio-gpio device
has not been successfully probed yet.

The offending commit is plain wrong for a number of reasons. First of
all it accesses internal driver data of an unrelated device. Neither
does it check that the data is non-null (which it is in case the device
has not been probed yet).

Furthermore, the decision on whether to treat any driver data according
to the mdio-gpio driver's internals is made based on the node name. But
the name is not compared against "mdio" which is the normal name for the
node, but rather against "gpio" which the node does not have to be named
(and shouldn't be according to the binding documentation). [ If this
hack is to be kept out-of-tree it should at least be matching against
the compatible property. ]

Cc: Stefan Roese <sr@denx.de>
Cc: stable <stable@vger.kernel.org> # v3.14
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw.c