net: flow_offload: Fix memory leak for indirect flow block
authorChris Mi <cmi@nvidia.com>
Tue, 8 Dec 2020 02:48:35 +0000 (10:48 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Dec 2020 12:28:17 +0000 (13:28 +0100)
commitfacb39d8ac8f690d07090724120bccd2ea3c0781
tree63a01c3c5fb409efdd376e07f82ef7730114a029
parentf9c84d022929be7c15747ab1fc8696e5271ccc60
net: flow_offload: Fix memory leak for indirect flow block

[ Upstream commit 5137d303659d8c324e67814b1cc2e1bc0c0d9836 ]

The offending commit introduces a cleanup callback that is invoked
when the driver module is removed to clean up the tunnel device
flow block. But it returns on the first iteration of the for loop.
The remaining indirect flow blocks will never be freed.

Fixes: 1fac52da5942 ("net: flow_offload: consolidate indirect flow_block infrastructure")
CC: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Chris Mi <cmi@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/core/flow_offload.c