diff options
author | Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> | 2005-09-23 00:44:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-23 01:17:37 -0400 |
commit | 79ae2cb856ed6a8c48f455d52d5ed5960c671e67 (patch) | |
tree | b72431f31bb99e03d86c40cbfb17e766034ac2ef /arch/um/drivers/chan_kern.c | |
parent | 46db4a42dd1190a311c2fb45106dfd0842c65a94 (diff) |
[PATCH] uml: use GFP_ATOMIC for allocations under spinlocks.
setup_initial_poll is only called with sigio_lock() held, so use appropriate
allocation.
Also, parse_chan() can also be called when holding a spinlock (see line_open()
-> parse_chan_pair()).
I have sporadic problems (spinlock taken twice, with spinlock debugging on UP)
which could be caused by a sequence like "take spinlock, alloc and go to
sleep, take again the spinlock in the other thread".
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/drivers/chan_kern.c')
-rw-r--r-- | arch/um/drivers/chan_kern.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c index 14a12d6b3df6..244e54a2153b 100644 --- a/arch/um/drivers/chan_kern.c +++ b/arch/um/drivers/chan_kern.c | |||
@@ -465,7 +465,7 @@ static struct chan *parse_chan(char *str, int pri, int device, | |||
465 | data = (*ops->init)(str, device, opts); | 465 | data = (*ops->init)(str, device, opts); |
466 | if(data == NULL) return(NULL); | 466 | if(data == NULL) return(NULL); |
467 | 467 | ||
468 | chan = kmalloc(sizeof(*chan), GFP_KERNEL); | 468 | chan = kmalloc(sizeof(*chan), GFP_ATOMIC); |
469 | if(chan == NULL) return(NULL); | 469 | if(chan == NULL) return(NULL); |
470 | *chan = ((struct chan) { .list = LIST_HEAD_INIT(chan->list), | 470 | *chan = ((struct chan) { .list = LIST_HEAD_INIT(chan->list), |
471 | .primary = 1, | 471 | .primary = 1, |