mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-07 04:09:21 +00:00
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>
This commit is contained in:
parent
078be02b80
commit
60abc786dd
1 changed files with 1 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue