]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
aoe: replace kmalloc and then memcpy with kmemdup
authorMihnea Dobrescu-Balaur <mihneadb@gmail.com>
Tue, 26 Mar 2013 23:26:05 +0000 (10:26 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 4 Apr 2013 06:26:28 +0000 (17:26 +1100)
Signed-off-by: Mihnea Dobrescu-Balaur <mihneadb@gmail.com>
Cc: Ed Cashin <ecashin@coraid.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/block/aoe/aoechr.c

index 42e67ad6bd207dabd505c779e131b9465dad3e82..ab41be625a5316e30ae2f30d1329e657196e98e2 100644 (file)
@@ -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;