diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2015-01-04 17:21:58 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2015-01-06 16:35:35 +0200 |
commit | 80e9541f7987f60471268b751aaa9b6800513fe9 (patch) | |
tree | 83060dd29ae78d40f1eb0574159dd9f85aa6ab22 /drivers/virtio | |
parent | b1940cd21c0f4abdce101253e860feff547291b0 (diff) | |
download | lwn-80e9541f7987f60471268b751aaa9b6800513fe9.tar.gz lwn-80e9541f7987f60471268b751aaa9b6800513fe9.zip |
virtio: make del_vqs idempotent
Our code calls del_vqs multiple times, assuming
it's idempotent.
commit 3ec7a77bb3089bb01032fdbd958eb5c29da58b49
virtio_pci: free up vq->priv
broke this assumption, by adding kfree there,
so multiple calls cause double free.
Fix it up.
Fixes: 3ec7a77bb3089bb01032fdbd958eb5c29da58b49
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/virtio')
-rw-r--r-- | drivers/virtio/virtio_pci_common.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c index 2ef9529809d8..5243868efd9a 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c @@ -282,6 +282,7 @@ void vp_del_vqs(struct virtio_device *vdev) vp_free_vectors(vdev); kfree(vp_dev->vqs); + vp_dev->vqs = NULL; } static int vp_try_to_find_vqs(struct virtio_device *vdev, unsigned nvqs, |