Skip to content

Commit

Permalink
ide-tape: cdev lock_kernel() pushdown
Browse files Browse the repository at this point in the history
->release() already has explicit lock_kernel() calls...

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
  • Loading branch information
Jonathan Corbet committed Jun 20, 2008
1 parent 16750c2 commit 04f4ac9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/ide/ide-tape.c
Original file line number Diff line number Diff line change
Expand Up @@ -2421,9 +2421,12 @@ static int idetape_chrdev_open(struct inode *inode, struct file *filp)
if (i >= MAX_HWIFS * MAX_DRIVES)
return -ENXIO;

lock_kernel();
tape = ide_tape_chrdev_get(i);
if (!tape)
if (!tape) {
unlock_kernel();
return -ENXIO;
}

debug_log(DBG_CHRDEV, "Enter %s\n", __func__);

Expand Down Expand Up @@ -2482,10 +2485,12 @@ static int idetape_chrdev_open(struct inode *inode, struct file *filp)
}
}
}
unlock_kernel();
return 0;

out_put_tape:
ide_tape_put(tape);
unlock_kernel();
return retval;
}

Expand Down

0 comments on commit 04f4ac9

Please sign in to comment.