ACRN:DM:VGPU: Fix the incorrect use after free
It still tries to access the gpu->vdpy_handel after the gpu is free. This is incorrect. Tracked-On: #7337 Acked-by: Wang Yu <yu1.wang@intel.com> Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
This commit is contained in:
parent
2a7a269313
commit
8b7767e643
|
@ -1680,12 +1680,13 @@ virtio_gpu_deinit(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vdpy_deinit(gpu->vdpy_handle);
|
||||||
|
|
||||||
if (gpu) {
|
if (gpu) {
|
||||||
pthread_mutex_destroy(&gpu->mtx);
|
pthread_mutex_destroy(&gpu->mtx);
|
||||||
free(gpu);
|
free(gpu);
|
||||||
}
|
}
|
||||||
virtio_gpu_device_cnt--;
|
virtio_gpu_device_cnt--;
|
||||||
vdpy_deinit(gpu->vdpy_handle);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t
|
uint64_t
|
||||||
|
|
Loading…
Reference in New Issue