aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/aoe/aoechr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/aoe/aoechr.c')
-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);
139 return; 139 return;
140 } 140 }
141 141
142 mp = kmalloc(n, GFP_ATOMIC); 142 mp = kmemdup(msg, n, GFP_ATOMIC);
143 if (mp == NULL) { 143 if (mp == NULL) {
144 printk(KERN_ERR "aoe: allocation failure, len=%ld\n", n); 144 printk(KERN_ERR "aoe: allocation failure, len=%ld\n", n);
145 goto bail; 145 goto bail;
146 } 146 }
147 147
148 memcpy(mp, msg, n);
149 em->msg = mp; 148 em->msg = mp;
150 em->flags |= EMFL_VALID; 149 em->flags |= EMFL_VALID;
151 em->len = n; 150 em->len = n;