]> Pileus Git - ~andy/linux/blobdiff - block/bsg.c
Merge branch 'for-2.6.31' of git://git.kernel.dk/linux-2.6-block
[~andy/linux] / block / bsg.c
index 2d746e34f4c24c1a0c70e627af78955ef9681af9..5358f9ae13c1797b7eda131c7033c73a0c525162 100644 (file)
@@ -315,6 +315,7 @@ out:
        blk_put_request(rq);
        if (next_rq) {
                blk_rq_unmap_user(next_rq->bio);
+               next_rq->bio = NULL;
                blk_put_request(next_rq);
        }
        return ERR_PTR(ret);
@@ -448,6 +449,7 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr,
                hdr->dout_resid = rq->resid_len;
                hdr->din_resid = rq->next_rq->resid_len;
                blk_rq_unmap_user(bidi_bio);
+               rq->next_rq->bio = NULL;
                blk_put_request(rq->next_rq);
        } else if (rq_data_dir(rq) == READ)
                hdr->din_resid = rq->resid_len;
@@ -466,6 +468,7 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr,
        blk_rq_unmap_user(bio);
        if (rq->cmd != rq->__cmd)
                kfree(rq->cmd);
+       rq->bio = NULL;
        blk_put_request(rq);
 
        return ret;