diff mbox

[odp-ovs,1/3] ofpbuf: init the buffer source before any other operations

Message ID 1421942949-12189-2-git-send-email-ciprian.barbu@linaro.org
State New
Headers show

Commit Message

Ciprian Barbu Jan. 22, 2015, 4:09 p.m. UTC
Signed-off-by: Ciprian Barbu <ciprian.barbu@linaro.org>
---
The source was not initialized before calling ofpbuf_init__, which is needed by
the ODP netdev implementation.

 lib/ofpbuf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/lib/ofpbuf.c b/lib/ofpbuf.c
index 764a799..6f27b47 100644
--- a/lib/ofpbuf.c
+++ b/lib/ofpbuf.c
@@ -38,11 +38,11 @@  static void
 ofpbuf_use__(struct ofpbuf *b, void *base, size_t allocated,
              enum ofpbuf_source source)
 {
+    ofpbuf_init__(b, allocated, source);
+
     ofpbuf_set_base(b, base);
     ofpbuf_set_data(b, base);
     ofpbuf_set_size(b, 0);
-
-    ofpbuf_init__(b, allocated, source);
 }
 
 /* Initializes 'b' as an empty ofpbuf that contains the 'allocated' bytes of