Skip to contentSkip to conversation

net/softnic: fix memory leak as profile is freed

PATCH Superseded [email protected] 3 participants 4 messages Jul 13, 2021 – Jul 30, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/softnic: fix memory leak as profile is freed

From: Dapeng Yu <[email protected]>

In function softnic_table_action_profile_free(), the memory referenced by pointer "ap" in the instance of "struct softnic_table_action_profile" is not freed.

This patch fixes it.

Fixes a737dd4e5863 ("net/softnic: add table action profile")
---
 drivers/net/softnic/rte_eth_softnic_action.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/softnic/rte_eth_softnic_action.c +1 -0
index 92c744dc9a..33be9552a6 100644
@@ -183,6 +183,7 @@ softnic_table_action_profile_free(struct pmd_internals *p)
 			break;
 
 		TAILQ_REMOVE(&p->table_action_profile_list, profile, node);
+		rte_table_action_profile_free(profile->ap);
 		free(profile);
 	}
 }
Signature · 1 line
2.27.0
Acked-by on v1 1/1
#1 lore raw
Quoted 39 lines

-----Original Message-----
From: Yu, DapengX <[email protected]>
Sent: Tuesday, July 13, 2021 9:27 AM
To: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: [email protected]; Yu, DapengX <[email protected]>; [email protected]
Subject: [PATCH] net/softnic: fix memory leak as profile is freed

From: Dapeng Yu <[email protected]>

In function softnic_table_action_profile_free(), the memory referenced by pointer "ap" in the instance of "struct softnic_table_action_profile" is not freed.

This patch fixes it.

Fixes a737dd4e5863 ("net/softnic: add table action profile")
---
 drivers/net/softnic/rte_eth_softnic_action.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/softnic/rte_eth_softnic_action.c +1 -0
index 92c744dc9a..33be9552a6 100644
@@ -183,6 +183,7 @@ softnic_table_action_profile_free(struct
 pmd_internals *p)
 			break;
 
 		TAILQ_REMOVE(&p->table_action_profile_list, profile,
 node);
+		rte_table_action_profile_free(profile->ap);
 		free(profile);
Quoted 4 lines

}
}
--
2.27.0

#2 lore raw

PATCH v2 1/1 net/softnic: fix memory leak as profile is freed

In reply to [email protected]

From: Dapeng Yu <[email protected]>

In function softnic_table_action_profile_free(), the memory referenced by pointer "ap" in the instance of "struct softnic_table_action_profile" is not freed.

This patch fixes it.

Fixes a737dd4e5863 ("net/softnic: add table action profile")

---
V2:
* Reapply patch on top of main branch.
* No difference from V1

---
 drivers/net/softnic/rte_eth_softnic_action.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/softnic/rte_eth_softnic_action.c +1 -0
index 92c744dc9a..33be9552a6 100644
@@ -183,6 +183,7 @@ softnic_table_action_profile_free(struct pmd_internals *p)
 			break;
 
 		TAILQ_REMOVE(&p->table_action_profile_list, profile, node);
+		rte_table_action_profile_free(profile->ap);
 		free(profile);
 	}
 }
Signature · 1 line
2.27.0
#3 lore raw

28/07/2021 08:05, [email protected]:

Quoted 6 lines

From: Dapeng Yu <[email protected]>

In function softnic_table_action_profile_free(), the memory referenced by pointer "ap" in the instance of "struct softnic_table_action_profile" is not freed.

Quoted 7 lines

This patch fixes it.

Fixes a737dd4e5863 ("net/softnic: add table action profile")

Applied, thanks.