Commit 6a20f9fc authored by Jason Wang's avatar Jason Wang Committed by Michael S. Tsirkin
Browse files

vhost: initialize vq->nheads properly



Commit 7918bb2d19c9 ("vhost: basic in order support") introduces
vq->nheads to store the number of batched used buffers per used elem
but it forgets to initialize the vq->nheads to NULL in
vhost_dev_init() this will cause kfree() that would try to free it
without be allocated if SET_OWNER is not called.

Reported-by: default avatarJAEHOON KIM <jhkim@linux.ibm.com>
Reported-by: default avatarBreno Leitao <leitao@debian.org>
Fixes: 45347e79 ("vhost: basic in order support")
Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
Message-Id: <20250729073916.80647-1-jasowang@redhat.com>
Reviewed-by: default avatarDawid Osuchowski <dawid.osuchowski@linux.intel.com>
Tested-by: default avatarBreno Leitao <leitao@debian.org>
Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
Tested-by: default avatarJaehoon Kim <jhkim@linux.ibm.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 7e161a99
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment