]> git.baikalelectronics.ru Git - kernel.git/commit
VMCI: Doorbell create and destroy fixes
authorJorgen Hansen <jhansen@vmware.com>
Thu, 6 Oct 2016 11:43:08 +0000 (04:43 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Oct 2016 12:26:21 +0000 (08:26 -0400)
commit3fc8e8073a60682fc65a5dede6f0b555d3fd7295
tree137aba204ea5ee978a4f8a908912192a834d0fe8
parentdde0886718d3ee04ea082980b5331c3da23bebba
VMCI: Doorbell create and destroy fixes

This change consists of two changes:

1) If vmci_doorbell_create is called when neither guest nor
   host personality as been initialized, vmci_get_context_id
   will return VMCI_INVALID_ID. In that case, we should fail
   the create call.
2) In doorbell destroy, we assume that vmci_guest_code_active()
   has the same return value on create and destroy. That may not
   be the case, so we may end up with the wrong refcount.
   Instead, destroy should check explicitly whether the doorbell
   is in the index table as an indicator of whether the guest
   code was active at create time.

Reviewed-by: Adit Ranadive <aditr@vmware.com>
Signed-off-by: Jorgen Hansen <jhansen@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/vmw_vmci/vmci_doorbell.c
drivers/misc/vmw_vmci/vmci_driver.c