]> git.karo-electronics.de Git - linux-beck.git/commitdiff
VMCI: Fix "always true condition"
authorAndy King <acking@vmware.com>
Thu, 10 Jan 2013 23:41:41 +0000 (15:41 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jan 2013 20:07:39 +0000 (12:07 -0800)
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>
drivers/misc/vmw_vmci/vmci_guest.c

index d302c89d2bfaa1d8d6d4fd7761f0ab8e771246e7..d7df6cfed28a0b1971463a578ab2f793a0784e9b 100644 (file)
@@ -78,7 +78,7 @@ bool vmci_guest_code_active(void)
 u32 vmci_get_vm_context_id(void)
 {
        if (vm_context_id == VMCI_INVALID_ID) {
-               u32 result;
+               int result;
                struct vmci_datagram get_cid_msg;
                get_cid_msg.dst =
                    vmci_make_handle(VMCI_HYPERVISOR_CONTEXT_ID,