* [PATCH net] net: flow_offload: Fix memory leak for indirect flow block
@ 2020-12-07 1:59 Chris Mi
2020-12-08 2:28 ` Jakub Kicinski
0 siblings, 1 reply; 3+ messages in thread
From: Chris Mi @ 2020-12-07 1:59 UTC (permalink / raw)
To: netdev; +Cc: roid, Chris Mi
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")
Signed-off-by: Chris Mi <cmi@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
---
net/core/flow_offload.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/core/flow_offload.c b/net/core/flow_offload.c
index d4474c812b64..715b67f6c62f 100644
--- a/net/core/flow_offload.c
+++ b/net/core/flow_offload.c
@@ -381,10 +381,8 @@ static void __flow_block_indr_cleanup(void (*release)(void *cb_priv),
list_for_each_entry_safe(this, next, &flow_block_indr_list, indr.list) {
if (this->release == release &&
- this->indr.cb_priv == cb_priv) {
+ this->indr.cb_priv == cb_priv)
list_move(&this->indr.list, cleanup_list);
- return;
- }
}
}
--
2.26.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: flow_offload: Fix memory leak for indirect flow block
2020-12-07 1:59 [PATCH net] net: flow_offload: Fix memory leak for indirect flow block Chris Mi
@ 2020-12-08 2:28 ` Jakub Kicinski
2020-12-08 2:49 ` Chris Mi
0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2020-12-08 2:28 UTC (permalink / raw)
To: Chris Mi; +Cc: netdev, roid
On Mon, 7 Dec 2020 09:59:16 +0800 Chris Mi wrote:
> 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")
> Signed-off-by: Chris Mi <cmi@nvidia.com>
> Reviewed-by: Roi Dayan <roid@nvidia.com>
Please repost and CC relevant people.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: flow_offload: Fix memory leak for indirect flow block
2020-12-08 2:28 ` Jakub Kicinski
@ 2020-12-08 2:49 ` Chris Mi
0 siblings, 0 replies; 3+ messages in thread
From: Chris Mi @ 2020-12-08 2:49 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: netdev, roid
On 12/8/2020 10:28 AM, Jakub Kicinski wrote:
> On Mon, 7 Dec 2020 09:59:16 +0800 Chris Mi wrote:
>> 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")
>> Signed-off-by: Chris Mi <cmi@nvidia.com>
>> Reviewed-by: Roi Dayan <roid@nvidia.com>
> Please repost and CC relevant people.
>
Done.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-12-08 2:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-07 1:59 [PATCH net] net: flow_offload: Fix memory leak for indirect flow block Chris Mi
2020-12-08 2:28 ` Jakub Kicinski
2020-12-08 2:49 ` Chris Mi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).