]> git.baikalelectronics.ru Git - kernel.git/commit
net: ethoc: Fix early error paths
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 12 Jul 2016 23:04:35 +0000 (16:04 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Jul 2016 06:13:01 +0000 (23:13 -0700)
commitc4609bf42f9f57ade9b7a10557eee25f3d9dbf57
tree04ea9b0c1baa41465a0141a812d145eb83e02d7c
parenta5c00d4c179119972d3223bd1f686f26d5b1865c
net: ethoc: Fix early error paths

In case any operation fails before we can successfully go the point
where we would register a MDIO bus, we would be going to an error label
which involves unregistering then freeing this yet to be created MDIO
bus. Update all error paths to go to label free which is the only one
valid until either the clock is enabled, or the MDIO bus is allocated
and registered. This fixes kernel oops observed while trying to
dereference the MDIO bus structure which is not yet allocated.

Fixes: b53478de799c ("net: Add support for the OpenCores 10/100 Mbps Ethernet MAC.")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ethoc.c