diff options
author | Ilya Maximets <i.maximets@samsung.com> | 2018-11-12 15:20:39 +0300 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2018-11-12 08:29:47 -0800 |
commit | 2b20cc51f47b52c9d3ea47868580c16be3938be6 (patch) | |
tree | 53eb36ce14d5e7c18f984a0a43a460c4ace08c70 /ovn | |
parent | 0f582e4bb1e7f17075a725758c59e2c339d364a2 (diff) | |
download | openvswitch-2b20cc51f47b52c9d3ea47868580c16be3938be6.tar.gz |
pinctrl: Fix dp_packet structure leak.
Buffered packets are always packets created by 'dp_packet_clone_data()'
i.e. they are malloced. It's not enough to free the packet data,
dp_packet structure must be freed too. 'dp_packet_delete()' will take
care of that.
Acked-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Fixes: d7abfe39cfd2 ("OVN: add buffering support for ip packets")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ovn')
-rw-r--r-- | ovn/controller/pinctrl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c index 21454ab47..56539a891 100644 --- a/ovn/controller/pinctrl.c +++ b/ovn/controller/pinctrl.c @@ -229,7 +229,7 @@ destroy_buffered_packets(struct buffered_packets *bp) while (bp->head != bp->tail) { bi = &bp->data[bp->head]; - dp_packet_uninit(bi->p); + dp_packet_delete(bi->p); ofpbuf_uninit(&bi->ofpacts); bp->head = (bp->head + 1) % BUFFER_QUEUE_DEPTH; @@ -267,7 +267,7 @@ buffered_push_packet(struct buffered_packets *bp, if (next == bp->head) { bi = &bp->data[bp->head]; - dp_packet_uninit(bi->p); + dp_packet_delete(bi->p); ofpbuf_uninit(&bi->ofpacts); bp->head = (bp->head + 1) % BUFFER_QUEUE_DEPTH; } @@ -296,7 +296,7 @@ buffered_send_packets(struct buffered_packets *bp, struct eth_addr *addr) queue_msg(ofputil_encode_packet_out(&po, proto)); ofpbuf_uninit(&bi->ofpacts); - dp_packet_uninit(bi->p); + dp_packet_delete(bi->p); bp->head = (bp->head + 1) % BUFFER_QUEUE_DEPTH; } |