diff options
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 300536697622..fa16bc30bbc9 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -1031,10 +1031,9 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device | |||
1031 | drive->nice1 = (arg >> IDE_NICE_1) & 1; | 1031 | drive->nice1 = (arg >> IDE_NICE_1) & 1; |
1032 | return 0; | 1032 | return 0; |
1033 | case HDIO_DRIVE_RESET: | 1033 | case HDIO_DRIVE_RESET: |
1034 | { | 1034 | if (!capable(CAP_SYS_ADMIN)) |
1035 | unsigned long flags; | 1035 | return -EACCES; |
1036 | if (!capable(CAP_SYS_ADMIN)) return -EACCES; | 1036 | |
1037 | |||
1038 | /* | 1037 | /* |
1039 | * Abort the current command on the | 1038 | * Abort the current command on the |
1040 | * group if there is one, taking | 1039 | * group if there is one, taking |
@@ -1053,17 +1052,15 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device | |||
1053 | ide_abort(drive, "drive reset"); | 1052 | ide_abort(drive, "drive reset"); |
1054 | 1053 | ||
1055 | BUG_ON(HWGROUP(drive)->handler); | 1054 | BUG_ON(HWGROUP(drive)->handler); |
1056 | 1055 | ||
1057 | /* Ensure nothing gets queued after we | 1056 | /* Ensure nothing gets queued after we |
1058 | drop the lock. Reset will clear the busy */ | 1057 | drop the lock. Reset will clear the busy */ |
1059 | 1058 | ||
1060 | HWGROUP(drive)->busy = 1; | 1059 | HWGROUP(drive)->busy = 1; |
1061 | spin_unlock_irqrestore(&ide_lock, flags); | 1060 | spin_unlock_irqrestore(&ide_lock, flags); |
1062 | (void) ide_do_reset(drive); | 1061 | (void) ide_do_reset(drive); |
1063 | 1062 | ||
1064 | return 0; | 1063 | return 0; |
1065 | } | ||
1066 | |||
1067 | case HDIO_GET_BUSSTATE: | 1064 | case HDIO_GET_BUSSTATE: |
1068 | if (!capable(CAP_SYS_ADMIN)) | 1065 | if (!capable(CAP_SYS_ADMIN)) |
1069 | return -EACCES; | 1066 | return -EACCES; |