The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] VMCI: Cocci spatch "memdup.spatch"
@ 2013-06-01  9:37 Thomas Meyer
  0 siblings, 0 replies; only message in thread
From: Thomas Meyer @ 2013-06-01  9:37 UTC (permalink / raw)
  To: linux-kernel


Signed-off-by: Thomas Meyer <thomas@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);



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-06-01  9:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-01  9:37 [PATCH] VMCI: Cocci spatch "memdup.spatch" Thomas Meyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox