diff options
Diffstat (limited to 'drivers/ide/ide-tape.c')
-rw-r--r-- | drivers/ide/ide-tape.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 39b0a5c45f07..6d622cb5ac81 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -1907,7 +1907,11 @@ static const struct file_operations idetape_fops = { | |||
1907 | 1907 | ||
1908 | static int idetape_open(struct block_device *bdev, fmode_t mode) | 1908 | static int idetape_open(struct block_device *bdev, fmode_t mode) |
1909 | { | 1909 | { |
1910 | struct ide_tape_obj *tape = ide_tape_get(bdev->bd_disk, false, 0); | 1910 | struct ide_tape_obj *tape; |
1911 | |||
1912 | lock_kernel(); | ||
1913 | tape = ide_tape_get(bdev->bd_disk, false, 0); | ||
1914 | unlock_kernel(); | ||
1911 | 1915 | ||
1912 | if (!tape) | 1916 | if (!tape) |
1913 | return -ENXIO; | 1917 | return -ENXIO; |
@@ -1919,7 +1923,10 @@ static int idetape_release(struct gendisk *disk, fmode_t mode) | |||
1919 | { | 1923 | { |
1920 | struct ide_tape_obj *tape = ide_drv_g(disk, ide_tape_obj); | 1924 | struct ide_tape_obj *tape = ide_drv_g(disk, ide_tape_obj); |
1921 | 1925 | ||
1926 | lock_kernel(); | ||
1922 | ide_tape_put(tape); | 1927 | ide_tape_put(tape); |
1928 | unlock_kernel(); | ||
1929 | |||
1923 | return 0; | 1930 | return 0; |
1924 | } | 1931 | } |
1925 | 1932 | ||