All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: phy: phylink: Don't release NULL GPIO
@ 2018-05-21  3:49 Florian Fainelli
  2018-05-21 12:00 ` Andrew Lunn
  2018-05-21 16:14 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Florian Fainelli @ 2018-05-21  3:49 UTC (permalink / raw)
  To: netdev
  Cc: rmk+kernel, Florian Fainelli, Andrew Lunn, David S. Miller, open list

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>
---
 drivers/net/phy/phylink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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)
 {
 	if (pl->sfp_bus)
 		sfp_unregister_upstream(pl->sfp_bus);
-	if (!IS_ERR(pl->link_gpio))
+	if (!IS_ERR_OR_NULL(pl->link_gpio))
 		gpiod_put(pl->link_gpio);
 
 	cancel_work_sync(&pl->resolve);
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: phy: phylink: Don't release NULL GPIO
  2018-05-21  3:49 [PATCH net-next] net: phy: phylink: Don't release NULL GPIO Florian Fainelli
@ 2018-05-21 12:00 ` Andrew Lunn
  2018-05-21 16:14 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2018-05-21 12:00 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: netdev, rmk+kernel, David S. Miller, open list

On Sun, May 20, 2018 at 08:49:47PM -0700, Florian Fainelli wrote:
> 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>

    Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: phy: phylink: Don't release NULL GPIO
  2018-05-21  3:49 [PATCH net-next] net: phy: phylink: Don't release NULL GPIO Florian Fainelli
  2018-05-21 12:00 ` Andrew Lunn
@ 2018-05-21 16:14 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-05-21 16:14 UTC (permalink / raw)
  To: f.fainelli; +Cc: netdev, rmk+kernel, andrew, linux-kernel

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Sun, 20 May 2018 20:49:47 -0700

> 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>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-21 16:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-21  3:49 [PATCH net-next] net: phy: phylink: Don't release NULL GPIO Florian Fainelli
2018-05-21 12:00 ` Andrew Lunn
2018-05-21 16:14 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.