aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/sbus/char/cpwatchdog.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/sbus/char/cpwatchdog.c b/drivers/sbus/char/cpwatchdog.c
index 235703414370..23abfdfb44f1 100644
--- a/drivers/sbus/char/cpwatchdog.c
+++ b/drivers/sbus/char/cpwatchdog.c
@@ -279,6 +279,7 @@ static inline int wd_opt_timeout(void)
279 279
280static int wd_open(struct inode *inode, struct file *f) 280static int wd_open(struct inode *inode, struct file *f)
281{ 281{
282 lock_kernel();
282 switch(iminor(inode)) 283 switch(iminor(inode))
283 { 284 {
284 case WD0_MINOR: 285 case WD0_MINOR:
@@ -291,6 +292,7 @@ static int wd_open(struct inode *inode, struct file *f)
291 f->private_data = &wd_dev.watchdog[WD2_ID]; 292 f->private_data = &wd_dev.watchdog[WD2_ID];
292 break; 293 break;
293 default: 294 default:
295 unlock_kernel();
294 return(-ENODEV); 296 return(-ENODEV);
295 } 297 }
296 298
@@ -304,11 +306,13 @@ static int wd_open(struct inode *inode, struct file *f)
304 (void *)wd_dev.regs)) { 306 (void *)wd_dev.regs)) {
305 printk("%s: Cannot register IRQ %d\n", 307 printk("%s: Cannot register IRQ %d\n",
306 WD_OBPNAME, wd_dev.irq); 308 WD_OBPNAME, wd_dev.irq);
309 unlock_kernel();
307 return(-EBUSY); 310 return(-EBUSY);
308 } 311 }
309 wd_dev.initialized = 1; 312 wd_dev.initialized = 1;
310 } 313 }
311 314
315 unlock_kernel();
312 return(nonseekable_open(inode, f)); 316 return(nonseekable_open(inode, f));
313} 317}
314 318