diff mbox

[ovs-dev,PATCHv2,2/2] ofp-parse: Improve comment for parse_ofp_packet_out_str().

Message ID 1498612484-60128-2-git-send-email-jpettit@ovn.org
State Accepted
Headers show

Commit Message

Justin Pettit June 28, 2017, 1:14 a.m. UTC
This function is a wrapper for parse_ofp_packet_out_str__(), which
states that a couple members must be freed on success.  This commit
updates the wrapper's description to indicate the same.

The existing callers appear to be properly freeing members.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
---
v1->v2: Unchanged.
---
 lib/ofp-parse.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Ben Pfaff July 5, 2017, 11:09 p.m. UTC | #1
On Tue, Jun 27, 2017 at 06:14:44PM -0700, Justin Pettit wrote:
> This function is a wrapper for parse_ofp_packet_out_str__(), which
> states that a couple members must be freed on success.  This commit
> updates the wrapper's description to indicate the same.
> 
> The existing callers appear to be properly freeing members.
> 
> Signed-off-by: Justin Pettit <jpettit@ovn.org>
> ---
> v1->v2: Unchanged.

Acked-by: Ben Pfaff <blp@ovn.org>
diff mbox

Patch

diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c
index 725fc41e063c..0c68495bfd3e 100644
--- a/lib/ofp-parse.c
+++ b/lib/ofp-parse.c
@@ -735,7 +735,9 @@  out:
  * switch.  Returns the set of usable protocols in '*usable_protocols'.
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
- * error.  The caller is responsible for freeing the returned string. */
+ * error.  The caller is responsible for freeing the returned string.
+ * If successful, both 'po->ofpacts' and 'po->packet' must be free()d by
+ * the caller. */
 char * OVS_WARN_UNUSED_RESULT
 parse_ofp_packet_out_str(struct ofputil_packet_out *po, const char *str_,
                          const struct ofputil_port_map *port_map,