diff options
Diffstat (limited to 'block/scsi_ioctl.c')
-rw-r--r-- | block/scsi_ioctl.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index 88fd008d38bd..daded70ffbb1 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c | |||
@@ -245,17 +245,7 @@ EXPORT_SYMBOL_GPL(blk_fill_sghdr_rq); | |||
245 | */ | 245 | */ |
246 | int blk_unmap_sghdr_rq(struct request *rq, struct sg_io_hdr *hdr) | 246 | int blk_unmap_sghdr_rq(struct request *rq, struct sg_io_hdr *hdr) |
247 | { | 247 | { |
248 | struct bio *bio = rq->bio; | 248 | blk_rq_unmap_user(rq->bio); |
249 | |||
250 | /* | ||
251 | * also releases request | ||
252 | */ | ||
253 | if (!hdr->iovec_count) | ||
254 | return blk_rq_unmap_user(bio, hdr->dxfer_len); | ||
255 | |||
256 | rq_for_each_bio(bio, rq) | ||
257 | bio_unmap_user(bio); | ||
258 | |||
259 | blk_put_request(rq); | 249 | blk_put_request(rq); |
260 | return 0; | 250 | return 0; |
261 | } | 251 | } |
@@ -335,7 +325,6 @@ static int sg_io(struct file *file, request_queue_t *q, | |||
335 | has_write_perm = file->f_mode & FMODE_WRITE; | 325 | has_write_perm = file->f_mode & FMODE_WRITE; |
336 | 326 | ||
337 | if (blk_fill_sghdr_rq(q, rq, hdr, has_write_perm)) { | 327 | if (blk_fill_sghdr_rq(q, rq, hdr, has_write_perm)) { |
338 | blk_rq_unmap_user(bio, hdr->dxfer_len); | ||
339 | blk_put_request(rq); | 328 | blk_put_request(rq); |
340 | return -EFAULT; | 329 | return -EFAULT; |
341 | } | 330 | } |