ecryptfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] eCryptfs: Cocci spatch "memdup.spatch"
@ 2013-06-01  9:39 Thomas Meyer
  2013-06-03  2:47 ` Tyler Hicks
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Meyer @ 2013-06-01  9:39 UTC (permalink / raw)
  To: ecryptfs, linux-kernel


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

diff -u -p a/fs/ecryptfs/messaging.c b/fs/ecryptfs/messaging.c
--- a/fs/ecryptfs/messaging.c
+++ b/fs/ecryptfs/messaging.c
@@ -247,14 +247,13 @@ int ecryptfs_process_response(struct ecr
 		goto unlock;
 	}
 	msg_size = (sizeof(*msg) + msg->data_len);
-	msg_ctx->msg = kmalloc(msg_size, GFP_KERNEL);
+	msg_ctx->msg = kmemdup(msg, msg_size, GFP_KERNEL);
 	if (!msg_ctx->msg) {
 		rc = -ENOMEM;
 		printk(KERN_ERR "%s: Failed to allocate [%zd] bytes of "
 		       "GFP_KERNEL memory\n", __func__, msg_size);
 		goto unlock;
 	}
-	memcpy(msg_ctx->msg, msg, msg_size);
 	msg_ctx->state = ECRYPTFS_MSG_CTX_STATE_DONE;
 	wake_up_process(msg_ctx->task);
 	rc = 0;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-03  2:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-01  9:39 [PATCH] eCryptfs: Cocci spatch "memdup.spatch" Thomas Meyer
2013-06-03  2:47 ` Tyler Hicks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).