X-Git-Url: https://nv-tegra.nvidia.com/r/gitweb?p=linux-2.6.git;a=blobdiff_plain;f=drivers%2Fscsi%2Fsg.c;h=040f751809ea97c4e09af568aa327e178e9f4218;hp=747a5e5c1276f62feb3f12f4c2ade154797e6d0b;hb=69585dd69e663a40729492c7b52eb82477a2027a;hpb=bd381934bf13ccb1af2813ae26c6fe00ec85d254 diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 747a5e5c127..040f751809e 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -1708,11 +1708,6 @@ static int sg_finish_rem_req(Sg_request * srp) Sg_scatter_hold *req_schp = &srp->data; SCSI_LOG_TIMEOUT(4, printk("sg_finish_rem_req: res_used=%d\n", (int) srp->res_used)); - if (srp->res_used) - sg_unlink_reserve(sfp, srp); - else - sg_remove_scat(req_schp); - if (srp->rq) { if (srp->bio) ret = blk_rq_unmap_user(srp->bio); @@ -1720,6 +1715,11 @@ static int sg_finish_rem_req(Sg_request * srp) blk_put_request(srp->rq); } + if (srp->res_used) + sg_unlink_reserve(sfp, srp); + else + sg_remove_scat(req_schp); + sg_remove_request(sfp, srp); return ret;