From d8c215adbf3901aa7d00a0f17f08d77be689f838 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 9 Sep 2011 17:36:37 -0400 Subject: um: convert count_lock to mutex, fix a race in line_open() If two processes are opening the same line, the second to get into line_open() will decide that it doesn't need to do anything (correctly) or wait for anything. The latter, unfortunately, is incorrect - the first opener might not be through yet. We need to have exclusion covering the entire line_init(), including the blocking parts. Moreover, the next patch will need to widen the exclusion on mconsole side of things, also including the blocking bits, so let's just convert that sucker to mutex... Signed-off-by: Al Viro Signed-off-by: Richard Weinberger --- arch/um/drivers/ssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/um/drivers/ssl.c') diff --git a/arch/um/drivers/ssl.c b/arch/um/drivers/ssl.c index 445288ff0650..23cffd6d85af 100644 --- a/arch/um/drivers/ssl.c +++ b/arch/um/drivers/ssl.c @@ -201,7 +201,7 @@ static int ssl_init(void) serial_lines[i].valid = 1; } spin_lock_init(&serial_lines[i].lock); - spin_lock_init(&serial_lines[i].count_lock); + mutex_init(&serial_lines[i].count_lock); serial_lines[i].driver = &driver; } ssl_driver = register_lines(&driver, &ssl_ops, serial_lines, -- cgit v1.2.3