diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/scsi_ioctl.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index 1b3fe99b83a6..48bb4e1ea1e7 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c @@ -484,9 +484,10 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode, break; } - if (bytes && blk_rq_map_kern(q, rq, buffer, bytes, GFP_NOIO)) { - err = DRIVER_ERROR << 24; - goto error; + if (bytes) { + err = blk_rq_map_kern(q, rq, buffer, bytes, GFP_NOIO); + if (err) + goto error; } blk_execute_rq(disk, rq, 0); |