mirror of
https://github.com/xemu-project/xemu.git
synced 2025-02-26 07:27:39 +00:00
hw/nvme: unregister the event notifier handler on the main loop
Make sure the notifier handler is unregistered in the main loop prior to cleaning it up. Fixes: 2e53b0b45024 ("hw/nvme: Use ioeventfd to handle doorbell updates") Reviewed-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Jinhao Fan <fanjinhao21s@ict.ac.cn> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
This commit is contained in:
parent
a2da737729
commit
04e8da8890
@ -4311,6 +4311,7 @@ static void nvme_free_sq(NvmeSQueue *sq, NvmeCtrl *n)
|
||||
if (sq->ioeventfd_enabled) {
|
||||
memory_region_del_eventfd(&n->iomem,
|
||||
0x1000 + offset, 4, false, 0, &sq->notifier);
|
||||
event_notifier_set_handler(&sq->notifier, NULL);
|
||||
event_notifier_cleanup(&sq->notifier);
|
||||
}
|
||||
g_free(sq->io_req);
|
||||
@ -4701,6 +4702,7 @@ static void nvme_free_cq(NvmeCQueue *cq, NvmeCtrl *n)
|
||||
if (cq->ioeventfd_enabled) {
|
||||
memory_region_del_eventfd(&n->iomem,
|
||||
0x1000 + offset, 4, false, 0, &cq->notifier);
|
||||
event_notifier_set_handler(&cq->notifier, NULL);
|
||||
event_notifier_cleanup(&cq->notifier);
|
||||
}
|
||||
if (msix_enabled(&n->parent_obj)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user