aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-tape.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-tape.c')
-rw-r--r--drivers/ide/ide-tape.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 1e1f26331a24..a3d228302d20 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -2421,9 +2421,12 @@ static int idetape_chrdev_open(struct inode *inode, struct file *filp)
2421 if (i >= MAX_HWIFS * MAX_DRIVES) 2421 if (i >= MAX_HWIFS * MAX_DRIVES)
2422 return -ENXIO; 2422 return -ENXIO;
2423 2423
2424 lock_kernel();
2424 tape = ide_tape_chrdev_get(i); 2425 tape = ide_tape_chrdev_get(i);
2425 if (!tape) 2426 if (!tape) {
2427 unlock_kernel();
2426 return -ENXIO; 2428 return -ENXIO;
2429 }
2427 2430
2428 debug_log(DBG_CHRDEV, "Enter %s\n", __func__); 2431 debug_log(DBG_CHRDEV, "Enter %s\n", __func__);
2429 2432
@@ -2482,10 +2485,12 @@ static int idetape_chrdev_open(struct inode *inode, struct file *filp)
2482 } 2485 }
2483 } 2486 }
2484 } 2487 }
2488 unlock_kernel();
2485 return 0; 2489 return 0;
2486 2490
2487out_put_tape: 2491out_put_tape:
2488 ide_tape_put(tape); 2492 ide_tape_put(tape);
2493 unlock_kernel();
2489 return retval; 2494 return retval;
2490} 2495}
2491 2496