Thread (65 messages) 65 messages, 7 authors, 2016-03-03
STALE3755d REVIEWED: 2 (0M)

[PATCH v6 6/6] l3fwd-power: fix a memory leak for non-ip packet

From: Shaopeng He <hidden>
Date: 2016-02-05 04:58:53
Subsystem: the rest · Maintainer: Linus Torvalds

Previous l3fwd-power only processes IP and IPv6 packet, other
packet's mbuf is not released, and causes a memory leak.
This patch fixes this issue.

Fixes: 3c0184cc ("examples: replace some offload flags with packet type")

Signed-off-by: Shaopeng He <redacted>
Acked-by: Jing Chen <redacted>
Acked-by: Michael Qiu <redacted>
---
v6 change:
  - add fixes line
v4 change:
  - update release note inside the patch
---
 doc/guides/rel_notes/release_2_3.rst | 6 ++++++
 examples/l3fwd-power/main.c          | 3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/doc/guides/rel_notes/release_2_3.rst b/doc/guides/rel_notes/release_2_3.rst
index 2cb5ebd..fc871ab 100644
--- a/doc/guides/rel_notes/release_2_3.rst
+++ b/doc/guides/rel_notes/release_2_3.rst
@@ -25,6 +25,12 @@ Libraries
 Examples
 ~~~~~~~~
 
+* **l3fwd-power: Fixed memory leak for non-ip packet.**
+
+  Fixed issue in l3fwd-power where, recieving other packet than
+  types of IP and IPv6, the mbuf was not released, and caused
+  a memory leak.
+
 
 Other
 ~~~~~
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index 828c18a..d9cd848 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -714,7 +714,8 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid,
 		/* We don't currently handle IPv6 packets in LPM mode. */
 		rte_pktmbuf_free(m);
 #endif
-	}
+	} else
+		rte_pktmbuf_free(m);
 
 }
 
-- 
1.9.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help