]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: mvpp2: Put fwnode in error case during ->probe()
authorAndy Shevchenko <andy.shevchenko@gmail.com>
Mon, 10 May 2021 09:58:05 +0000 (12:58 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:15:49 +0000 (16:15 +0200)
commitb4bbd7605fe1e7aa47de7ee6619ae5c84e653adc
tree81614644f337912f566ea4251b0f5efc73b021ca
parentbbf4fff7b4e35472ca324ad6f57baf08b03aec63
net: mvpp2: Put fwnode in error case during ->probe()

[ Upstream commit 71f0891c84dfdc448736082ab0a00acd29853896 ]

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c