]> git.baikalelectronics.ru Git - kernel.git/commit
phy: add proper phy struct device refcounting
authorRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 24 Sep 2015 19:36:08 +0000 (20:36 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 25 Sep 2015 06:04:52 +0000 (23:04 -0700)
commit6f0702984622b1c4e6311abd6b009810e86868c2
tree8dbce2e4e1eb98757ef30b537977d447999b1582
parent2a4b2f4902952d16d26c6cc03048a39eddec89b0
phy: add proper phy struct device refcounting

Take a refcount on the phy struct device when the phy device is attached
to a network device, and drop it after it's detached.  This ensures that
a refcount is held on the phy device while the device is being used by
a network device, thereby preventing the phy_device from being
unexpectedly kfree()'d by phy_device_release().

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy_device.c