diff options
author | Woojung Huh <woojung.huh@microchip.com> | 2016-11-24 02:10:33 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-26 03:57:57 +0300 |
commit | a7dac9f9c1695d7470b2f4e7447513e4a71b7c1b (patch) | |
tree | 1118e18f73b9b8c74b7a049f4c48395ee2b2212a /drivers/net/phy/phy_led_triggers.c | |
parent | f52dffe049ee11ecc02588a118fbe4092672fbaa (diff) | |
download | linux-a7dac9f9c1695d7470b2f4e7447513e4a71b7c1b.tar.xz |
phy: fix error case of phy_led_triggers_(un)register
When phy_init_hw() fails at phy_attach_direct();
- phy_detach() calls phy_led_triggers_unregister() without
previous call of phy_led_triggers_register().
- still call phy_led_triggers_register() and cause memory leak.
Fixes: 2e0bc452f472 ("net: phy: leds: add support for led triggers on phy link state change")
Signed-off-by: Woojung Huh <woojung.huh@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/phy_led_triggers.c')
-rw-r--r-- | drivers/net/phy/phy_led_triggers.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/net/phy/phy_led_triggers.c b/drivers/net/phy/phy_led_triggers.c index cda600a1b766..fa62bdf2f526 100644 --- a/drivers/net/phy/phy_led_triggers.c +++ b/drivers/net/phy/phy_led_triggers.c @@ -130,7 +130,5 @@ void phy_led_triggers_unregister(struct phy_device *phy) for (i = 0; i < phy->phy_num_led_triggers; i++) phy_led_trigger_unregister(&phy->phy_led_triggers[i]); - - devm_kfree(&phy->mdio.dev, phy->phy_led_triggers); } EXPORT_SYMBOL_GPL(phy_led_triggers_unregister); |