All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: arc_emac: Fix memleak in arc_mdio_probe
@ 2020-08-23  8:56 Dinghao Liu
  2020-08-23 14:35 ` Andrew Lunn
  2020-08-25  1:00 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Dinghao Liu @ 2020-08-23  8:56 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: David S. Miller, Jakub Kicinski, Heiko Stuebner, Caesar Wang,
	netdev, linux-kernel

When devm_gpiod_get_optional() fails, bus should be
freed just like when of_mdiobus_register() fails.

Fixes: 1bddd96cba03d ("net: arc_emac: support the phy reset for emac driver")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
 drivers/net/ethernet/arc/emac_mdio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/arc/emac_mdio.c b/drivers/net/ethernet/arc/emac_mdio.c
index 0187dbf3b87d..54cdafdd067d 100644
--- a/drivers/net/ethernet/arc/emac_mdio.c
+++ b/drivers/net/ethernet/arc/emac_mdio.c
@@ -153,6 +153,7 @@ int arc_mdio_probe(struct arc_emac_priv *priv)
 	if (IS_ERR(data->reset_gpio)) {
 		error = PTR_ERR(data->reset_gpio);
 		dev_err(priv->dev, "Failed to request gpio: %d\n", error);
+		mdiobus_free(bus);
 		return error;
 	}
 
-- 
2.17.1


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

* Re: [PATCH] net: arc_emac: Fix memleak in arc_mdio_probe
  2020-08-23  8:56 [PATCH] net: arc_emac: Fix memleak in arc_mdio_probe Dinghao Liu
@ 2020-08-23 14:35 ` Andrew Lunn
  2020-08-25  1:00 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2020-08-23 14:35 UTC (permalink / raw)
  To: Dinghao Liu
  Cc: kjlu, David S. Miller, Jakub Kicinski, Heiko Stuebner,
	Caesar Wang, netdev, linux-kernel

On Sun, Aug 23, 2020 at 04:56:47PM +0800, Dinghao Liu wrote:
> When devm_gpiod_get_optional() fails, bus should be
> freed just like when of_mdiobus_register() fails.
> 
> Fixes: 1bddd96cba03d ("net: arc_emac: support the phy reset for emac driver")
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH] net: arc_emac: Fix memleak in arc_mdio_probe
  2020-08-23  8:56 [PATCH] net: arc_emac: Fix memleak in arc_mdio_probe Dinghao Liu
  2020-08-23 14:35 ` Andrew Lunn
@ 2020-08-25  1:00 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-08-25  1:00 UTC (permalink / raw)
  To: dinghao.liu; +Cc: kjlu, kuba, heiko, wxt, netdev, linux-kernel

From: Dinghao Liu <dinghao.liu@zju.edu.cn>
Date: Sun, 23 Aug 2020 16:56:47 +0800

> When devm_gpiod_get_optional() fails, bus should be
> freed just like when of_mdiobus_register() fails.
> 
> Fixes: 1bddd96cba03d ("net: arc_emac: support the phy reset for emac driver")
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>

Applied, thank you.

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

end of thread, other threads:[~2020-08-25  1:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-23  8:56 [PATCH] net: arc_emac: Fix memleak in arc_mdio_probe Dinghao Liu
2020-08-23 14:35 ` Andrew Lunn
2020-08-25  1:00 ` 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.