diff options
Diffstat (limited to 'drivers/char/amigamouse.c')
-rw-r--r-- | drivers/char/amigamouse.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/char/amigamouse.c b/drivers/char/amigamouse.c index 823ec88ea..0cdfc264a 100644 --- a/drivers/char/amigamouse.c +++ b/drivers/char/amigamouse.c @@ -162,6 +162,10 @@ static int release_mouse(struct inode * inode, struct file * file) static int open_mouse(struct inode * inode, struct file * file) { + /* Lock module first - request_irq might sleep */ + + MOD_INC_USE_COUNT; + /* * use VBL to poll mouse deltas */ @@ -169,10 +173,10 @@ static int open_mouse(struct inode * inode, struct file * file) if(request_irq(IRQ_AMIGA_VERTB, mouse_interrupt, 0, "Amiga mouse", mouse_interrupt)) { printk(KERN_INFO "Installing Amiga mouse failed.\n"); + MOD_DEC_USE_COUNT; return -EIO; } - MOD_INC_USE_COUNT; #if AMIGA_OLD_INT AMI_MSE_INT_ON(); #endif |