blk_rq_unmap_user in sg_finish_rem_req can take care of all the cases.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
err = -EFAULT;
goto err_out;
}
- if (srp->bio) {
- err = blk_rq_unmap_user(srp->bio);
- srp->bio = NULL;
- }
err_out:
sg_finish_rem_req(srp);
return (0 == err) ? count : err;
if ((!outp) || (num_read_xfer <= 0))
return 0;
- blk_rq_unmap_user(srp->bio);
- srp->bio = NULL;
-
num = 1 << (PAGE_SHIFT + schp->page_order);
for (k = 0; k < schp->k_use_sg && schp->pages[k]; k++) {
if (num > num_read_xfer) {