diff mbox

[ovs-dev] ofproto-dpif-upcall: prevent memory leak on log message

Message ID 1465401851-30232-1-git-send-email-cascardo@redhat.com
State Accepted
Headers show

Commit Message

Thadeu Lima de Souza Cascardo June 8, 2016, 4:04 p.m. UTC
When DPIF does not support UFID (like old kernels), it may print this message
quite frequently, if using an OVS version that does not include the upstream fix
af50de8 ("ofproto-dpif-upcall: Pass key to dpif_flow_get().").

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Fixes: af50de8 ("ofproto-dpif-upcall: Pass key to dpif_flow_get().")
---
 ofproto/ofproto-dpif-upcall.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Joe Stringer June 8, 2016, 4:58 p.m. UTC | #1
On 8 June 2016 at 09:04, Thadeu Lima de Souza Cascardo
<cascardo@redhat.com> wrote:
> When DPIF does not support UFID (like old kernels), it may print this message
> quite frequently, if using an OVS version that does not include the upstream fix
> af50de8 ("ofproto-dpif-upcall: Pass key to dpif_flow_get().").
>
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
> Fixes: af50de8 ("ofproto-dpif-upcall: Pass key to dpif_flow_get().")

Thanks for the fix.

It seems to me that af50de8 ("ofproto-dpif-upcall: Pass key to
dpif_flow_get().") makes this problem less likely, while 64bb477f0568
("dpif: Minimize memory copy for revalidation.") is the commit which
actually introduced the bug. I updated the "Fixes:" tag and used this
commit to determine which branches the fix should apply to.

Applied to master, branch-2.5 and branch-2.4.
Thadeu Lima de Souza Cascardo June 8, 2016, 5:36 p.m. UTC | #2
On Wed, Jun 08, 2016 at 09:58:51AM -0700, Joe Stringer wrote:
> On 8 June 2016 at 09:04, Thadeu Lima de Souza Cascardo
> <cascardo@redhat.com> wrote:
> > When DPIF does not support UFID (like old kernels), it may print this message
> > quite frequently, if using an OVS version that does not include the upstream fix
> > af50de8 ("ofproto-dpif-upcall: Pass key to dpif_flow_get().").
> >
> > Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
> > Fixes: af50de8 ("ofproto-dpif-upcall: Pass key to dpif_flow_get().")
> 
> Thanks for the fix.
> 
> It seems to me that af50de8 ("ofproto-dpif-upcall: Pass key to
> dpif_flow_get().") makes this problem less likely, while 64bb477f0568
> ("dpif: Minimize memory copy for revalidation.") is the commit which
> actually introduced the bug. I updated the "Fixes:" tag and used this
> commit to determine which branches the fix should apply to.
> 
> Applied to master, branch-2.5 and branch-2.4.

Yes, I meant 64bb477f0568. My bad while copy and pasting the commit reference.

Thanks.
Cascardo.
diff mbox

Patch

diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index 1374950..a18fc5a 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -2056,6 +2056,7 @@  log_unexpected_flow(const struct dpif_flow *flow, int error)
                   "unexpected flow (%s): ", ovs_strerror(error));
     odp_format_ufid(&flow->ufid, &ds);
     VLOG_WARN_RL(&rl, "%s", ds_cstr(&ds));
+    ds_destroy(&ds);
 }
 
 static void