* [PATCH 2.6] fix duart locking
@ 2004-09-16 0:19 Peter Buckingham
0 siblings, 0 replies; only message in thread
From: Peter Buckingham @ 2004-09-16 0:19 UTC (permalink / raw)
To: Ralf Baechle, linux-mips
[-- Attachment #1: Type: text/plain, Size: 229 bytes --]
Hi Ralf,
the duart code tries to hold a spin lock across a call to
copy_from_user(). This patch releases the spin lock before the call and
reacquires it afterwards.
peter
Signed-off-by: Peter Buckingham <peter@pantasys.com>
[-- Attachment #2: p --]
[-- Type: text/plain, Size: 966 bytes --]
? drivers/i2c/algos/.built-in.o.cmd
? drivers/i2c/algos/.i2c-algo-bit.o.cmd
? drivers/i2c/busses/.built-in.o.cmd
? drivers/i2c/chips/.built-in.o.cmd
? drivers/input/misc/.built-in.o.cmd
? drivers/input/misc/.pcspkr.o.cmd
? drivers/input/misc/.uinput.o.cmd
Index: drivers/char/sb1250_duart.c
===================================================================
RCS file: /home/cvs/linux/drivers/char/sb1250_duart.c,v
retrieving revision 1.23
diff -u -r1.23 sb1250_duart.c
--- drivers/char/sb1250_duart.c 15 Oct 2003 16:19:12 -0000 1.23
+++ drivers/char/sb1250_duart.c 16 Sep 2004 00:10:31 -0000
@@ -326,10 +326,11 @@
if (c <= 0) break;
if (from_user) {
+ spin_unlock_irqrestore(&us->outp_lock, flags);
if (copy_from_user(us->outp_buf + us->outp_tail, buf, c)) {
- spin_unlock_irqrestore(&us->outp_lock, flags);
return -EFAULT;
}
+ spin_lock_irqsave(&us->outp_lock, flags);
} else {
memcpy(us->outp_buf + us->outp_tail, buf, c);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-09-16 0:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-16 0:19 [PATCH 2.6] fix duart locking Peter Buckingham
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox