Signed-off-by: Thomas Meyer <tho...@m3y3r.de>
---

diff -u -p a/drivers/misc/vmw_vmci/vmci_datagram.c 
b/drivers/misc/vmw_vmci/vmci_datagram.c
--- a/drivers/misc/vmw_vmci/vmci_datagram.c
+++ b/drivers/misc/vmw_vmci/vmci_datagram.c
@@ -276,11 +276,10 @@ static int dg_dispatch_as_host(u32 conte
                }
 
                /* 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);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to