Commit aa3aff5b authored by Florian Fainelli's avatar Florian Fainelli Committed by Greg Kroah-Hartman

net: phy: phylink: Don't release NULL GPIO

[ Upstream commit 3bcd4772 ]

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: daab3349 ("net: phy: phylink: Release link GPIO")
Signed-off-by: default avatarFlorian Fainelli <>
Reviewed-by: default avatarAndrew Lunn <>
Signed-off-by: default avatarDavid S. Miller <>
Signed-off-by: default avatarSasha Levin <>
parent f72388e3
......@@ -561,7 +561,7 @@ void phylink_destroy(struct phylink *pl)
if (pl->sfp_bus)
if (!IS_ERR(pl->link_gpio))
if (!IS_ERR_OR_NULL(pl->link_gpio))
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment