hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/misc/vmw_vmci/vmci_host.c
....@@ -165,10 +165,16 @@
165165 static __poll_t vmci_host_poll(struct file *filp, poll_table *wait)
166166 {
167167 struct vmci_host_dev *vmci_host_dev = filp->private_data;
168
- struct vmci_ctx *context = vmci_host_dev->context;
168
+ struct vmci_ctx *context;
169169 __poll_t mask = 0;
170170
171171 if (vmci_host_dev->ct_type == VMCIOBJ_CONTEXT) {
172
+ /*
173
+ * Read context only if ct_type == VMCIOBJ_CONTEXT to make
174
+ * sure that context is initialized
175
+ */
176
+ context = vmci_host_dev->context;
177
+
172178 /* Check for VMCI calls to this VM context. */
173179 if (wait)
174180 poll_wait(filp, &context->host_context.wait_queue,