Skip to content

Commit 0e7894d

Browse files
Andy Kinggregkh
authored andcommitted
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>
1 parent 32b083a commit 0e7894d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/misc/vmw_vmci/vmci_guest.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ bool vmci_guest_code_active(void)
7878
u32 vmci_get_vm_context_id(void)
7979
{
8080
if (vm_context_id == VMCI_INVALID_ID) {
81-
u32 result;
81+
int result;
8282
struct vmci_datagram get_cid_msg;
8383
get_cid_msg.dst =
8484
vmci_make_handle(VMCI_HYPERVISOR_CONTEXT_ID,

0 commit comments

Comments
 (0)