diff mbox series

[net-next,v1,1/4] net: mvpp2: Put fwnode in error case during ->probe()

Message ID 20210510095808.3302997-1-andy.shevchenko@gmail.com (mailing list archive)
State Accepted
Commit 71f0891c84dfdc448736082ab0a00acd29853896
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v1,1/4] net: mvpp2: Put fwnode in error case during ->probe() | expand

Checks

Context Check Description
netdev/cover_letter warning Series does not have a cover letter
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 5 this patch: 5
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 5 this patch: 5
netdev/header_inline success Link

Commit Message

Andy Shevchenko May 10, 2021, 9:58 a.m. UTC
In each iteration fwnode_for_each_available_child_node() bumps a reference
counting of a loop variable followed by dropping in on a next iteration,

Since in error case the loop is broken, we have to drop a reference count
by ourselves. Do it for port_fwnode in error case during ->probe().

Fixes: 248122212f68 ("net: mvpp2: use device_*/fwnode_* APIs instead of of_*")
Cc: Marcin Wojtas <mw@semihalf.com>
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

patchwork-bot+netdevbpf@kernel.org May 10, 2021, 10:20 p.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (refs/heads/master):

On Mon, 10 May 2021 12:58:05 +0300 you wrote:
> In each iteration fwnode_for_each_available_child_node() bumps a reference
> counting of a loop variable followed by dropping in on a next iteration,
> 
> Since in error case the loop is broken, we have to drop a reference count
> by ourselves. Do it for port_fwnode in error case during ->probe().
> 
> Fixes: 248122212f68 ("net: mvpp2: use device_*/fwnode_* APIs instead of of_*")
> Cc: Marcin Wojtas <mw@semihalf.com>
> Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> 
> [...]

Here is the summary with links:
  - [net-next,v1,1/4] net: mvpp2: Put fwnode in error case during ->probe()
    https://git.kernel.org/netdev/net-next/c/71f0891c84df
  - [net-next,v1,2/4] net: mvpp2: Use device_get_match_data() helper
    https://git.kernel.org/netdev/net-next/c/692b82c57f71
  - [net-next,v1,3/4] net: mvpp2: Use devm_clk_get_optional()
    https://git.kernel.org/netdev/net-next/c/cf3399b731d3
  - [net-next,v1,4/4] net: mvpp2: Unshadow error code of device_property_read_u32()
    https://git.kernel.org/netdev/net-next/c/584525554fd6

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index ec706d614cac..b48c08829a31 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -7552,6 +7552,8 @@  static int mvpp2_probe(struct platform_device *pdev)
 	return 0;
 
 err_port_probe:
+	fwnode_handle_put(port_fwnode);
+
 	i = 0;
 	fwnode_for_each_available_child_node(fwnode, port_fwnode) {
 		if (priv->port_list[i])