From: Andrew Morton <akpm@linux-foundation.org> Date: Sun, 6 May 2007 21:50:39 +0000 (-0700) Subject: srmcons: fix kmalloc(GFP_KERNEL) inside spinlock X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2af0bc94a665f22975de11bddcf6c57907ce8255;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git srmcons: fix kmalloc(GFP_KERNEL) inside spinlock Fixes http://bugzilla.kernel.org/show_bug.cgi?id=8341 Cc: <matthias.kaehlcke@gmail.com> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> --- diff --git a/arch/alpha/kernel/srmcons.c b/arch/alpha/kernel/srmcons.c index 756923203860..85a821aaceb4 100644 --- a/arch/alpha/kernel/srmcons.c +++ b/arch/alpha/kernel/srmcons.c @@ -164,9 +164,9 @@ srmcons_get_private_struct(struct srmcons_private **ps) int retval = 0; if (srmconsp == NULL) { + srmconsp = kmalloc(sizeof(*srmconsp), GFP_KERNEL); spin_lock_irqsave(&srmconsp_lock, flags); - srmconsp = kmalloc(sizeof(*srmconsp), GFP_KERNEL); if (srmconsp == NULL) retval = -ENOMEM; else {