Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

aoe: replace kmalloc and then memcpy with kmemdup

Signed-off-by: Mihnea Dobrescu-Balaur <mihneadb@gmail.com>
Cc: Ed Cashin <ecashin@coraid.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Mihnea Dobrescu-Balaur and committed by
Linus Torvalds
60abc786 078be02b

+1 -2
+1 -2
drivers/block/aoe/aoechr.c
··· 139 139 return; 140 140 } 141 141 142 - mp = kmalloc(n, GFP_ATOMIC); 142 + mp = kmemdup(msg, n, GFP_ATOMIC); 143 143 if (mp == NULL) { 144 144 printk(KERN_ERR "aoe: allocation failure, len=%ld\n", n); 145 145 goto bail; 146 146 } 147 147 148 - memcpy(mp, msg, n); 149 148 em->msg = mp; 150 149 em->flags |= EMFL_VALID; 151 150 em->len = n;