net: mscc: ocelot: add missing of_node_put after calling of_get_child_by_name
authorWen Yang <wenyang@linux.alibaba.com>
Sun, 29 Sep 2019 06:54:24 +0000 (14:54 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Oct 2019 17:01:58 +0000 (10:01 -0700)
commitd2c50b1cd94528aea8c8e9abb4cce81590f32cc4
tree711d4ed6cedd7f807ba0e38310129db4398fb681
parent83c8c3cf45163f0c823db37be6ab04dfcf8ac751
net: mscc: ocelot: add missing of_node_put after calling of_get_child_by_name

of_node_put needs to be called when the device node which is got
from of_get_child_by_name finished using.
In both cases of success and failure, we need to release 'ports',
so clean up the code using goto.

fixes: a556c76adc05 ("net: mscc: Add initial Ocelot switch support")
Signed-off-by: Wen Yang <wenyang@linux.alibaba.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mscc/ocelot_board.c