]> git.baikalelectronics.ru Git - kernel.git/commit
vdpa_sim: cleanup kiovs in vdpasim_free()
authorStefano Garzarella <sgarzare@redhat.com>
Mon, 15 Mar 2021 16:34:43 +0000 (17:34 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 3 May 2021 08:55:53 +0000 (04:55 -0400)
commitf747ede4f0c94a6facf27dd7b37ccdcdd2ac67a3
treeba1da0720fc678033fadd91874a7c822fdc6c4b3
parent25398299403fc3f5f2957187b617a0150bbb8b3b
vdpa_sim: cleanup kiovs in vdpasim_free()

vringh_getdesc_iotlb() allocates memory to store the kvec, that
is freed with vringh_kiov_cleanup().

vringh_getdesc_iotlb() is able to reuse a kvec previously allocated,
so in order to avoid to allocate the kvec for each request, we are
not calling vringh_kiov_cleanup() when we finished to handle a
request, but we should call it when we free the entire device.

Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20210315163450.254396-8-sgarzare@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vdpa/vdpa_sim/vdpa_sim.c