]> git.baikalelectronics.ru Git - kernel.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)
committerDavid S. Miller <davem@davemloft.net>
Mon, 10 May 2021 21:47:23 +0000 (14:47 -0700)
commitaa783316571c0d9aac710eebaa708ad25c026f38
tree413bad284d2e9f0e6aef448e562f351b4c69e3a9
parent62fbb9b7a2ae0d97090686b869115648cb2fc817
net: mvpp2: Put fwnode in error case during ->probe()

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: 9cfd99465ba5 ("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>
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c