Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

VMCI: Fix "always true condition"

vmci_send_datagram() returns an int, with negative values indicating failure.
But we store it locally in a u32, which makes comparison of >= 0 useless.
Fixed to use an int.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andy King <acking@vmware.com>
Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Andy King and committed by
Greg Kroah-Hartman
0e7894dc 32b083a3

+1 -1
+1 -1
drivers/misc/vmw_vmci/vmci_guest.c
··· 78 78 u32 vmci_get_vm_context_id(void) 79 79 { 80 80 if (vm_context_id == VMCI_INVALID_ID) { 81 - u32 result; 81 + int result; 82 82 struct vmci_datagram get_cid_msg; 83 83 get_cid_msg.dst = 84 84 vmci_make_handle(VMCI_HYPERVISOR_CONTEXT_ID,