]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: phy: phylink: Don't release NULL GPIO
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 21 May 2018 03:49:47 +0000 (20:49 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Nov 2018 13:52:45 +0000 (14:52 +0100)
commitaa3aff5b469b7520932fa8816efb78a0eaf012d4
treebfb55bf2f595669a1e5ae9622600dd4d24bcc083
parentf72388e3670e870a32854058eff63d0021036457
net: phy: phylink: Don't release NULL GPIO

[ Upstream commit 3bcd47726c3b744fd08781795cca905cc59a1382 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/phy/phylink.c