diff options
Diffstat (limited to 'block/ll_rw_blk.c')
-rw-r--r-- | block/ll_rw_blk.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 5d472e47c125..a66ec30855d8 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
@@ -2504,6 +2504,7 @@ EXPORT_SYMBOL(blk_rq_map_user_iov); | |||
2504 | int blk_rq_unmap_user(struct request *rq) | 2504 | int blk_rq_unmap_user(struct request *rq) |
2505 | { | 2505 | { |
2506 | struct bio *bio, *mapped_bio; | 2506 | struct bio *bio, *mapped_bio; |
2507 | int ret = 0, ret2; | ||
2507 | 2508 | ||
2508 | while ((bio = rq->bio)) { | 2509 | while ((bio = rq->bio)) { |
2509 | if (bio_flagged(bio, BIO_BOUNCED)) | 2510 | if (bio_flagged(bio, BIO_BOUNCED)) |
@@ -2511,11 +2512,15 @@ int blk_rq_unmap_user(struct request *rq) | |||
2511 | else | 2512 | else |
2512 | mapped_bio = bio; | 2513 | mapped_bio = bio; |
2513 | 2514 | ||
2514 | __blk_rq_unmap_user(mapped_bio); | 2515 | ret2 = __blk_rq_unmap_user(mapped_bio); |
2516 | if (ret2 && !ret) | ||
2517 | ret = ret2; | ||
2518 | |||
2515 | rq->bio = bio->bi_next; | 2519 | rq->bio = bio->bi_next; |
2516 | bio_put(bio); | 2520 | bio_put(bio); |
2517 | } | 2521 | } |
2518 | return 0; | 2522 | |
2523 | return ret; | ||
2519 | } | 2524 | } |
2520 | 2525 | ||
2521 | EXPORT_SYMBOL(blk_rq_unmap_user); | 2526 | EXPORT_SYMBOL(blk_rq_unmap_user); |