aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAndy King <acking@vmware.com>2013-01-22 09:15:04 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-22 09:29:26 -0800
commit5a19b78972c39be0c5378c14c23e6c998683e80f (patch)
treebc2039eb5e3d14efc3140bc480c2a4109c0d66d8 /drivers
parent74465645cdb4391b9fc95d12fd750a88012ad479 (diff)
VMCI: Fix broken context ID retrieval
I'm an idiot. The context ID can be a really large unsigned number, which means it'll appear negative as an int. So actually the right fix here is just to set it regardless of the returned value (but only for this particular hypercall; normally we would check it). Acked-by: Dmitry Torokhov <dtor@vmware.com> Signed-off-by: Andy King <acking@vmware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/misc/vmw_vmci/vmci_guest.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/misc/vmw_vmci/vmci_guest.c b/drivers/misc/vmw_vmci/vmci_guest.c
index de1a90be160a..60c01999f489 100644
--- a/drivers/misc/vmw_vmci/vmci_guest.c
+++ b/drivers/misc/vmw_vmci/vmci_guest.c
@@ -81,16 +81,13 @@ bool vmci_guest_code_active(void)
u32 vmci_get_vm_context_id(void)
{
if (vm_context_id == VMCI_INVALID_ID) {
- int result;
struct vmci_datagram get_cid_msg;
get_cid_msg.dst =
vmci_make_handle(VMCI_HYPERVISOR_CONTEXT_ID,
VMCI_GET_CONTEXT_ID);
get_cid_msg.src = VMCI_ANON_SRC_HANDLE;
get_cid_msg.payload_size = 0;
- result = vmci_send_datagram(&get_cid_msg);
- if (result >= 0)
- vm_context_id = result;
+ vm_context_id = vmci_send_datagram(&get_cid_msg);
}
return vm_context_id;
}

Privacy Policy