[PATCH V2] net: dsa: Add of_node_put() before break statement

Andrew Lunn andrew at lunn.ch
Sun Aug 23 15:13:08 EDT 2020


> diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
> index 8dcb8a49ab67..e81198a65c26 100644
> --- a/drivers/net/dsa/mt7530.c
> +++ b/drivers/net/dsa/mt7530.c
> @@ -1327,6 +1327,7 @@ mt7530_setup(struct dsa_switch *ds)
>  			if (phy_node->parent == priv->dev->of_node->parent) {
>  				ret = of_get_phy_mode(mac_np, &interface);
>  				if (ret && ret != -ENODEV)
> +					of_node_put(mac_np)
>  					return ret;
>  				id = of_mdio_parse_addr(ds->dev, phy_node);
>  				if (id == 0)

You are missing some { }. And a ; . I'm surprised gcc did not warn
you!

    Andrew



More information about the linux-arm-kernel mailing list