From: Mihnea Dobrescu-Balaur Date: Tue, 30 Apr 2013 22:28:29 +0000 (-0700) Subject: aoe: replace kmalloc and then memcpy with kmemdup X-Git-Tag: v4.0~4202^2~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=60abc786dd3b5d6917d63fd789c9fed772f65039;p=platform%2Fkernel%2Flinux-amlogic.git aoe: replace kmalloc and then memcpy with kmemdup Signed-off-by: Mihnea Dobrescu-Balaur Cc: Ed Cashin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/block/aoe/aoechr.c b/drivers/block/aoe/aoechr.c index 42e67ad..ab41be62 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;