Skip to content

Commit

Permalink
net: dsa: mv88e6xxx: fix unreleased fwnode_handle in setup_port()
Browse files Browse the repository at this point in the history
'ports_fwnode' is initialized via device_get_named_child_node(), which
requires a call to fwnode_handle_put() when the variable is no longer
required to avoid leaking memory.

Add the missing fwnode_handle_put() after 'ports_fwnode' has been used
and is no longer required.

Fixes: 94a2a84 ("net: dsa: mv88e6xxx: Support LED control")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Javier Carrasco authored and David S. Miller committed Oct 28, 2024
1 parent 788d5d6 commit b8ee7a1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/dsa/mv88e6xxx/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -3379,6 +3379,7 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
break;
}
}
fwnode_handle_put(ports_fwnode);
} else {
dev_dbg(chip->dev, "no ethernet ports node defined for the device\n");
}
Expand Down

0 comments on commit b8ee7a1

Please sign in to comment.