Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60abc786 authored by Mihnea Dobrescu-Balaur's avatar Mihnea Dobrescu-Balaur Committed by Linus Torvalds
Browse files

aoe: replace kmalloc and then memcpy with kmemdup



Signed-off-by: default avatarMihnea Dobrescu-Balaur <mihneadb@gmail.com>
Cc: Ed Cashin <ecashin@coraid.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 078be02b
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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;