aoe: replace kmalloc and then memcpy with kmemdup
Subsystems (2)
PATCH 1/1 aoe: replace kmalloc and then memcpy with kmemdup
Signed-off-by Mihnea Dobrescu-Balaur <[email protected]>
--- drivers/block/aoe/aoechr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/block/aoe/aoechr.c +1 -2
@@ -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;
Signature · 1 line
1.7.10.4
Looks OK, thanks.
Quoted 27 lines · Mihnea Dobrescu-Balaur
Signed-off-by Mihnea Dobrescu-Balaur <[email protected]>---
drivers/block/aoe/aoechr.c| 3 +--1 file changed, 1 insertion(+), 2 deletions(-)drivers/block/aoe/aoechr.c +1
-2@@ -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;Signature · 1 line
1.7.10.4
Signature · 2 lines
Ed Cashin [email protected]