summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorPetr Malat <oss@malat.biz>2013-02-28 02:01:52 +0100
committerDavid S. Miller <davem@davemloft.net>2013-02-28 21:37:30 +0100
commitb2a431915d19893f047e0dd149d0c1b9d2a0b960 (patch)
treee3e507b869479b8ba8b09667b159c3dbc606cf4c /drivers/net/ethernet
parentbnx2x: Fix KR2 work-around condition (diff)
downloadlinux-b2a431915d19893f047e0dd149d0c1b9d2a0b960.tar.xz
linux-b2a431915d19893f047e0dd149d0c1b9d2a0b960.zip
phy: Fix phy_device_free memory leak
Fix memory leak in phy_device_free() for the case when phy_device* returned by phy_device_create() is not registered in the system. Bug description: phy_device_create() sets name of kobject using dev_set_name(), which allocates memory using kvasprintf(), but this memory isn't freed if the underlying device isn't registered properly, because kobject_cleanup() is not called in that case. This can happen (and actually is happening on our machines) if phy_device_register(), called by mdiobus_scan(), fails. Patch description: Embedded struct device is initialized in phy_device_create() and it counterpart phy_device_free() just drops one reference to the device, which leads to proper deinitialization including releasing the kobject name memory. Signed-off-by: Petr Malat <oss@malat.biz> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
0 files changed, 0 insertions, 0 deletions