diff options
| author | Florian Fainelli <f.fainelli@gmail.com> | 2018-05-20 23:49:47 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2018-05-21 12:13:05 -0400 |
| commit | 3bcd47726c3b744fd08781795cca905cc59a1382 (patch) | |
| tree | 4a2f0c508abeeaa42e69be09ad685c5cb999a350 | |
| parent | 7ddae24f97f9fc8f151aae75f0371ced06a8cd99 (diff) | |
net: phy: phylink: Don't release NULL GPIO
If CONFIG_GPIOLIB is disabled, gpiod_put() becomes a stub that produces a
warning, this helped identify that we could be attempting to release a NULL
pl->link_gpio GPIO descriptor, so guard against that.
Fixes: daab3349ad1a ("net: phy: phylink: Release link GPIO")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | drivers/net/phy/phylink.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 581ce93ecaf9..af4dc4425be2 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c | |||
| @@ -624,7 +624,7 @@ void phylink_destroy(struct phylink *pl) | |||
| 624 | { | 624 | { |
| 625 | if (pl->sfp_bus) | 625 | if (pl->sfp_bus) |
| 626 | sfp_unregister_upstream(pl->sfp_bus); | 626 | sfp_unregister_upstream(pl->sfp_bus); |
| 627 | if (!IS_ERR(pl->link_gpio)) | 627 | if (!IS_ERR_OR_NULL(pl->link_gpio)) |
| 628 | gpiod_put(pl->link_gpio); | 628 | gpiod_put(pl->link_gpio); |
| 629 | 629 | ||
| 630 | cancel_work_sync(&pl->resolve); | 630 | cancel_work_sync(&pl->resolve); |
