net: dsa: felix: Fix memory leak in felix_setup_mmio_filtering
authorJosé Expósito <jose.exposito89@gmail.com>
Thu, 9 Dec 2021 11:05:40 +0000 (12:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Dec 2021 09:57:10 +0000 (10:57 +0100)
commit973a0373e88cc19129bd6ef0ec193040535397d9
tree2a50073af169c8a50ad45e7cf0a8fd66f534f7e4
parentbfc017140aa7a79fb67a08f4038d559f15875554
net: dsa: felix: Fix memory leak in felix_setup_mmio_filtering

commit e8b1d7698038e76363859fb47ae0a262080646f5 upstream.

Avoid a memory leak if there is not a CPU port defined.

Fixes: 8d5f7954b7c8 ("net: dsa: felix: break at first CPU port during init and teardown")
Addresses-Coverity-ID: 1492897 ("Resource leak")
Addresses-Coverity-ID: 1492899 ("Resource leak")
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20211209110538.11585-1-jose.exposito89@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/dsa/ocelot/felix.c