diff options
Diffstat (limited to 'kernel/drivers/misc/vmw_vmci')
-rw-r--r-- | kernel/drivers/misc/vmw_vmci/vmci_datagram.c | 3 | ||||
-rw-r--r-- | kernel/drivers/misc/vmw_vmci/vmci_host.c | 7 |
2 files changed, 2 insertions, 8 deletions
diff --git a/kernel/drivers/misc/vmw_vmci/vmci_datagram.c b/kernel/drivers/misc/vmw_vmci/vmci_datagram.c index 822665245..8a4b6bbe1 100644 --- a/kernel/drivers/misc/vmw_vmci/vmci_datagram.c +++ b/kernel/drivers/misc/vmw_vmci/vmci_datagram.c @@ -276,11 +276,10 @@ static int dg_dispatch_as_host(u32 context_id, struct vmci_datagram *dg) } /* We make a copy to enqueue. */ - new_dg = kmalloc(dg_size, GFP_KERNEL); + new_dg = kmemdup(dg, dg_size, GFP_KERNEL); if (new_dg == NULL) return VMCI_ERROR_NO_MEM; - memcpy(new_dg, dg, dg_size); retval = vmci_ctx_enqueue_datagram(dg->dst.context, new_dg); if (retval < VMCI_SUCCESS) { kfree(new_dg); diff --git a/kernel/drivers/misc/vmw_vmci/vmci_host.c b/kernel/drivers/misc/vmw_vmci/vmci_host.c index a721b5d8a..9ec262a52 100644 --- a/kernel/drivers/misc/vmw_vmci/vmci_host.c +++ b/kernel/drivers/misc/vmw_vmci/vmci_host.c @@ -1031,14 +1031,9 @@ int __init vmci_host_init(void) void __exit vmci_host_exit(void) { - int error; - vmci_host_device_initialized = false; - error = misc_deregister(&vmci_host_miscdev); - if (error) - pr_warn("Error unregistering character device: %d\n", error); - + misc_deregister(&vmci_host_miscdev); vmci_ctx_destroy(host_context); vmci_qp_broker_exit(); |