diff options
Diffstat (limited to 'block/scsi_ioctl.c')
-rw-r--r-- | block/scsi_ioctl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index c34272a348fe..c525905f9d35 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c | |||
@@ -384,7 +384,8 @@ int sg_scsi_ioctl(struct file *file, struct request_queue *q, | |||
384 | struct gendisk *disk, struct scsi_ioctl_command __user *sic) | 384 | struct gendisk *disk, struct scsi_ioctl_command __user *sic) |
385 | { | 385 | { |
386 | struct request *rq; | 386 | struct request *rq; |
387 | int err, write_perm = 0; | 387 | int err; |
388 | fmode_t write_perm = 0; | ||
388 | unsigned int in_len, out_len, bytes, opcode, cmdlen; | 389 | unsigned int in_len, out_len, bytes, opcode, cmdlen; |
389 | char *buffer = NULL, sense[SCSI_SENSE_BUFFERSIZE]; | 390 | char *buffer = NULL, sense[SCSI_SENSE_BUFFERSIZE]; |
390 | 391 | ||
@@ -428,7 +429,7 @@ int sg_scsi_ioctl(struct file *file, struct request_queue *q, | |||
428 | 429 | ||
429 | /* scsi_ioctl passes NULL */ | 430 | /* scsi_ioctl passes NULL */ |
430 | if (file && (file->f_mode & FMODE_WRITE)) | 431 | if (file && (file->f_mode & FMODE_WRITE)) |
431 | write_perm = 1; | 432 | write_perm = FMODE_WRITE; |
432 | 433 | ||
433 | err = blk_verify_command(&q->cmd_filter, rq->cmd, write_perm); | 434 | err = blk_verify_command(&q->cmd_filter, rq->cmd, write_perm); |
434 | if (err) | 435 | if (err) |