diff --git a/drivers/virt/nitro_enclaves/ne_misc_dev.c b/drivers/virt/nitro_enclaves/ne_misc_dev.c index f36d6cb3..b4b1ebbd 100644 --- a/drivers/virt/nitro_enclaves/ne_misc_dev.c +++ b/drivers/virt/nitro_enclaves/ne_misc_dev.c @@ -1645,9 +1645,13 @@ static __poll_t ne_enclave_poll(struct file *file, poll_table *wait) poll_wait(file, &ne_enclave->eventq, wait); + mutex_lock(&ne_enclave->enclave_info_mutex); + if (ne_enclave->has_event) mask |= EPOLLHUP; + mutex_unlock(&ne_enclave->enclave_info_mutex); + return mask; }