Skip to content

Commit

Permalink
VMCI: Fix "always true condition"
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andy King <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Andy King authored and gregkh committed Jan 17, 2013
1 parent 32b083a commit 0e7894d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/misc/vmw_vmci/vmci_guest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0e7894d

Please sign in to comment.