Commit 29673983 authored by Andrew Lunn's avatar Andrew Lunn Committed by David S. Miller

net: phy: marvell: Fix double free of hwmon device

The hwmon temperature sensor devices is registered using a devm_hwmon
API call.  The marvell_release() would then manually free the device,
not using a devm_hmon API, resulting in the device being removed
twice, leading to a crash in kernfs_find_ns() during the second
removal.

Remove the manual removal, which makes marvell_release() empty, so
remove it as well.
Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Fixes: 0b04680f ("phy: marvell: Add support for temperature sensor")
Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b3b8812e
...@@ -1883,17 +1883,6 @@ static int m88e1510_probe(struct phy_device *phydev) ...@@ -1883,17 +1883,6 @@ static int m88e1510_probe(struct phy_device *phydev)
return m88e1510_hwmon_probe(phydev); return m88e1510_hwmon_probe(phydev);
} }
static void marvell_remove(struct phy_device *phydev)
{
#ifdef CONFIG_HWMON
struct marvell_priv *priv = phydev->priv;
if (priv && priv->hwmon_dev)
hwmon_device_unregister(priv->hwmon_dev);
#endif
}
static struct phy_driver marvell_drivers[] = { static struct phy_driver marvell_drivers[] = {
{ {
.phy_id = MARVELL_PHY_ID_88E1101, .phy_id = MARVELL_PHY_ID_88E1101,
...@@ -1974,7 +1963,6 @@ static struct phy_driver marvell_drivers[] = { ...@@ -1974,7 +1963,6 @@ static struct phy_driver marvell_drivers[] = {
.features = PHY_GBIT_FEATURES, .features = PHY_GBIT_FEATURES,
.flags = PHY_HAS_INTERRUPT, .flags = PHY_HAS_INTERRUPT,
.probe = &m88e1121_probe, .probe = &m88e1121_probe,
.remove = &marvell_remove,
.config_init = &m88e1121_config_init, .config_init = &m88e1121_config_init,
.config_aneg = &m88e1121_config_aneg, .config_aneg = &m88e1121_config_aneg,
.read_status = &marvell_read_status, .read_status = &marvell_read_status,
...@@ -2087,7 +2075,6 @@ static struct phy_driver marvell_drivers[] = { ...@@ -2087,7 +2075,6 @@ static struct phy_driver marvell_drivers[] = {
.features = PHY_GBIT_FEATURES | SUPPORTED_FIBRE, .features = PHY_GBIT_FEATURES | SUPPORTED_FIBRE,
.flags = PHY_HAS_INTERRUPT, .flags = PHY_HAS_INTERRUPT,
.probe = &m88e1510_probe, .probe = &m88e1510_probe,
.remove = &marvell_remove,
.config_init = &m88e1510_config_init, .config_init = &m88e1510_config_init,
.config_aneg = &m88e1510_config_aneg, .config_aneg = &m88e1510_config_aneg,
.read_status = &marvell_read_status, .read_status = &marvell_read_status,
...@@ -2109,7 +2096,6 @@ static struct phy_driver marvell_drivers[] = { ...@@ -2109,7 +2096,6 @@ static struct phy_driver marvell_drivers[] = {
.features = PHY_GBIT_FEATURES, .features = PHY_GBIT_FEATURES,
.flags = PHY_HAS_INTERRUPT, .flags = PHY_HAS_INTERRUPT,
.probe = m88e1510_probe, .probe = m88e1510_probe,
.remove = &marvell_remove,
.config_init = &marvell_config_init, .config_init = &marvell_config_init,
.config_aneg = &m88e1510_config_aneg, .config_aneg = &m88e1510_config_aneg,
.read_status = &marvell_read_status, .read_status = &marvell_read_status,
...@@ -2127,7 +2113,6 @@ static struct phy_driver marvell_drivers[] = { ...@@ -2127,7 +2113,6 @@ static struct phy_driver marvell_drivers[] = {
.phy_id_mask = MARVELL_PHY_ID_MASK, .phy_id_mask = MARVELL_PHY_ID_MASK,
.name = "Marvell 88E1545", .name = "Marvell 88E1545",
.probe = m88e1510_probe, .probe = m88e1510_probe,
.remove = &marvell_remove,
.features = PHY_GBIT_FEATURES, .features = PHY_GBIT_FEATURES,
.flags = PHY_HAS_INTERRUPT, .flags = PHY_HAS_INTERRUPT,
.config_init = &marvell_config_init, .config_init = &marvell_config_init,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment