Skip to content

Commit

Permalink
vhost: fix double-free with zero-copy
Browse files Browse the repository at this point in the history
zmbufs should be set to NULL when getting freed to avoid double free on
the same buffer pointer

Fixes: b0a985d ("vhost: add dequeue zero copy")
Cc: stable@dpdk.org

Signed-off-by: Patrick Fu <patrick.fu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
  • Loading branch information
Patrick Fu authored and Ferruh Yigit committed Jul 21, 2020
1 parent 47958f7 commit a608436
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/librte_vhost/vhost_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -1934,6 +1934,7 @@ free_zmbufs(struct vhost_virtqueue *vq)
drain_zmbuf_list(vq);

rte_free(vq->zmbufs);
vq->zmbufs = NULL;
}

/*
Expand Down

0 comments on commit a608436

Please sign in to comment.