summaryrefslogtreecommitdiffstats
path: root/drivers/block/aoe
diff options
context:
space:
mode:
authorMihnea Dobrescu-Balaur <mihneadb@gmail.com>2013-05-01 00:28:29 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-01 02:04:08 +0200
commit60abc786dd3b5d6917d63fd789c9fed772f65039 (patch)
tree22df39466f7dc6a3d16d5763e8e33c5e3e0f3fe6 /drivers/block/aoe
parentnbd: increase default and max request sizes (diff)
downloadlinux-60abc786dd3b5d6917d63fd789c9fed772f65039.tar.xz
linux-60abc786dd3b5d6917d63fd789c9fed772f65039.zip
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>
Diffstat (limited to 'drivers/block/aoe')
-rw-r--r--drivers/block/aoe/aoechr.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/block/aoe/aoechr.c b/drivers/block/aoe/aoechr.c
index 42e67ad6bd20..ab41be625a53 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;