aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-floppy_ioctl.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2010-08-11 03:36:51 -0400
committerJiri Kosina <jkosina@suse.cz>2010-08-11 03:36:51 -0400
commit6396fc3b3ff3f6b942992b653a62df11dcef9bea (patch)
treedb3c7cbe833b43c653adc99f70941431c5ff7c4e /drivers/ide/ide-floppy_ioctl.c
parent4785879e4d340e24e54f6de2ccfc42728b912808 (diff)
parent3d30701b58970425e1d45994d6cb82f828924fdd (diff)
Merge branch 'master' into for-next
Conflicts: fs/exofs/inode.c
Diffstat (limited to 'drivers/ide/ide-floppy_ioctl.c')
-rw-r--r--drivers/ide/ide-floppy_ioctl.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/ide/ide-floppy_ioctl.c b/drivers/ide/ide-floppy_ioctl.c
index 9c2288234dea..fd3d05ab3417 100644
--- a/drivers/ide/ide-floppy_ioctl.c
+++ b/drivers/ide/ide-floppy_ioctl.c
@@ -5,6 +5,7 @@
5#include <linux/kernel.h> 5#include <linux/kernel.h>
6#include <linux/ide.h> 6#include <linux/ide.h>
7#include <linux/cdrom.h> 7#include <linux/cdrom.h>
8#include <linux/smp_lock.h>
8 9
9#include <asm/unaligned.h> 10#include <asm/unaligned.h>
10 11
@@ -275,12 +276,15 @@ int ide_floppy_ioctl(ide_drive_t *drive, struct block_device *bdev,
275 void __user *argp = (void __user *)arg; 276 void __user *argp = (void __user *)arg;
276 int err; 277 int err;
277 278
278 if (cmd == CDROMEJECT || cmd == CDROM_LOCKDOOR) 279 lock_kernel();
279 return ide_floppy_lockdoor(drive, &pc, arg, cmd); 280 if (cmd == CDROMEJECT || cmd == CDROM_LOCKDOOR) {
281 err = ide_floppy_lockdoor(drive, &pc, arg, cmd);
282 goto out;
283 }
280 284
281 err = ide_floppy_format_ioctl(drive, &pc, mode, cmd, argp); 285 err = ide_floppy_format_ioctl(drive, &pc, mode, cmd, argp);
282 if (err != -ENOTTY) 286 if (err != -ENOTTY)
283 return err; 287 goto out;
284 288
285 /* 289 /*
286 * skip SCSI_IOCTL_SEND_COMMAND (deprecated) 290 * skip SCSI_IOCTL_SEND_COMMAND (deprecated)
@@ -293,5 +297,7 @@ int ide_floppy_ioctl(ide_drive_t *drive, struct block_device *bdev,
293 if (err == -ENOTTY) 297 if (err == -ENOTTY)
294 err = generic_ide_ioctl(drive, bdev, cmd, arg); 298 err = generic_ide_ioctl(drive, bdev, cmd, arg);
295 299
300out:
301 unlock_kernel();
296 return err; 302 return err;
297} 303}