mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] aoe: replace kmalloc and then memcpy with kmemdup
@ 2013-03-11 11:16 Mihnea Dobrescu-Balaur
  2013-03-11 17:44 ` Ed Cashin
  0 siblings, 1 reply; 2+ messages in thread
From: Mihnea Dobrescu-Balaur @ 2013-03-11 11:16 UTC (permalink / raw)
  To: linux-kernel; +Cc: ecashin, Mihnea Dobrescu-Balaur

Signed-off-by: Mihnea Dobrescu-Balaur <mihneadb@gmail.com>
---
 drivers/block/aoe/aoechr.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/block/aoe/aoechr.c b/drivers/block/aoe/aoechr.c
index 42e67ad..ab41be6 100644
--- a/drivers/block/aoe/aoechr.c
+++ b/drivers/block/aoe/aoechr.c
@@ -139,13 +139,12 @@ bail:		spin_unlock_irqrestore(&emsgs_lock, flags);
 		return;
 	}
 
-	mp = kmalloc(n, GFP_ATOMIC);
+	mp = kmemdup(msg, n, GFP_ATOMIC);
 	if (mp == NULL) {
 		printk(KERN_ERR "aoe: allocation failure, len=%ld\n", n);
 		goto bail;
 	}
 
-	memcpy(mp, msg, n);
 	em->msg = mp;
 	em->flags |= EMFL_VALID;
 	em->len = n;
-- 
1.7.10.4


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

* Re: [PATCH] aoe: replace kmalloc and then memcpy with kmemdup
  2013-03-11 11:16 [PATCH] aoe: replace kmalloc and then memcpy with kmemdup Mihnea Dobrescu-Balaur
@ 2013-03-11 17:44 ` Ed Cashin
  0 siblings, 0 replies; 2+ messages in thread
From: Ed Cashin @ 2013-03-11 17:44 UTC (permalink / raw)
  To: Mihnea Dobrescu-Balaur; +Cc: linux-kernel, Andrew Morton

Looks OK, thanks.

On Mar 11, 2013, at 7:16 AM, Mihnea Dobrescu-Balaur wrote:

> Signed-off-by: Mihnea Dobrescu-Balaur <mihneadb@gmail.com>
> ---
> drivers/block/aoe/aoechr.c |    3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/block/aoe/aoechr.c b/drivers/block/aoe/aoechr.c
> index 42e67ad..ab41be6 100644
> --- a/drivers/block/aoe/aoechr.c
> +++ b/drivers/block/aoe/aoechr.c
> @@ -139,13 +139,12 @@ bail:		spin_unlock_irqrestore(&emsgs_lock, flags);
> 		return;
> 	}
> 
> -	mp = kmalloc(n, GFP_ATOMIC);
> +	mp = kmemdup(msg, n, GFP_ATOMIC);
> 	if (mp == NULL) {
> 		printk(KERN_ERR "aoe: allocation failure, len=%ld\n", n);
> 		goto bail;
> 	}
> 
> -	memcpy(mp, msg, n);
> 	em->msg = mp;
> 	em->flags |= EMFL_VALID;
> 	em->len = n;
> -- 
> 1.7.10.4
> 

-- 
  Ed Cashin
  ecashin@coraid.com



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

end of thread, other threads:[~2013-03-11 17:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-11 11:16 [PATCH] aoe: replace kmalloc and then memcpy with kmemdup Mihnea Dobrescu-Balaur
2013-03-11 17:44 ` Ed Cashin

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

all inboxes | Powered by JetHome®