drivers/char/amiserial.c: add missing local_irq_restore
authorJulia Lawall <julia@diku.dk>
Tue, 6 Apr 2010 21:34:46 +0000 (14:34 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 7 Apr 2010 15:38:02 +0000 (08:38 -0700)
commitc70c036f04b7b74282477d6a51bbcc8bb8897e03
tree9a5a42056298ef700f06c1608c7670982bb0aa87
parenta8557dc71949e80c298ec298b902ac6ebbc5d9dd
drivers/char/amiserial.c: add missing local_irq_restore

rs_init() is failing to restore interrupts on two error paths, and is
incorrectly calling tty_unregister_driver() with local interrupts
disabled.

Fix these things by disabling interrupts later, after the reauest_irq()
calls.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression E1;
identifier f;
@@

f (...) { <+...
* local_irq_save (E1,...);
... when != E1
* return ...;
...+> }
// </smpl>

[akpm@linux-foundation.org: reimplement the fix]
Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/amiserial.c