diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/bsg.c | 2 | ||||
-rw-r--r-- | block/scsi_ioctl.c | 10 |
2 files changed, 4 insertions, 8 deletions
diff --git a/block/bsg.c b/block/bsg.c index c85d961ee41e..0427ece9b6d8 100644 --- a/block/bsg.c +++ b/block/bsg.c | |||
@@ -900,7 +900,7 @@ bsg_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
900 | case SG_EMULATED_HOST: | 900 | case SG_EMULATED_HOST: |
901 | case SCSI_IOCTL_SEND_COMMAND: { | 901 | case SCSI_IOCTL_SEND_COMMAND: { |
902 | void __user *uarg = (void __user *) arg; | 902 | void __user *uarg = (void __user *) arg; |
903 | return scsi_cmd_ioctl(file, bd->disk, cmd, uarg); | 903 | return scsi_cmd_ioctl(file, bd->queue, bd->disk, cmd, uarg); |
904 | } | 904 | } |
905 | case SG_IO: { | 905 | case SG_IO: { |
906 | struct request *rq; | 906 | struct request *rq; |
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index db53b2c268d3..a26ba07955fe 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c | |||
@@ -548,16 +548,12 @@ static inline int blk_send_start_stop(request_queue_t *q, struct gendisk *bd_dis | |||
548 | return __blk_send_generic(q, bd_disk, GPCMD_START_STOP_UNIT, data); | 548 | return __blk_send_generic(q, bd_disk, GPCMD_START_STOP_UNIT, data); |
549 | } | 549 | } |
550 | 550 | ||
551 | int scsi_cmd_ioctl(struct file *file, struct gendisk *bd_disk, unsigned int cmd, void __user *arg) | 551 | int scsi_cmd_ioctl(struct file *file, struct request_queue *q, |
552 | struct gendisk *bd_disk, unsigned int cmd, void __user *arg) | ||
552 | { | 553 | { |
553 | request_queue_t *q; | ||
554 | int err; | 554 | int err; |
555 | 555 | ||
556 | q = bd_disk->queue; | 556 | if (!q || blk_get_queue(q)) |
557 | if (!q) | ||
558 | return -ENXIO; | ||
559 | |||
560 | if (blk_get_queue(q)) | ||
561 | return -ENXIO; | 557 | return -ENXIO; |
562 | 558 | ||
563 | switch (cmd) { | 559 | switch (cmd) { |