From 2af0bc94a665f22975de11bddcf6c57907ce8255 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sun, 6 May 2007 14:50:39 -0700 Subject: [PATCH] srmcons: fix kmalloc(GFP_KERNEL) inside spinlock Fixes http://bugzilla.kernel.org/show_bug.cgi?id=8341 Cc: Cc: Richard Henderson Cc: Ivan Kokshaysky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/alpha/kernel/srmcons.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/alpha/kernel/srmcons.c b/arch/alpha/kernel/srmcons.c index 7569232038..85a821aace 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 { -- 2.39.5