diff options
Diffstat (limited to 'block/bsg.c')
-rw-r--r-- | block/bsg.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/block/bsg.c b/block/bsg.c index 206060e795da..dd81be455e00 100644 --- a/block/bsg.c +++ b/block/bsg.c | |||
@@ -315,6 +315,7 @@ out: | |||
315 | blk_put_request(rq); | 315 | blk_put_request(rq); |
316 | if (next_rq) { | 316 | if (next_rq) { |
317 | blk_rq_unmap_user(next_rq->bio); | 317 | blk_rq_unmap_user(next_rq->bio); |
318 | next_rq->bio = NULL; | ||
318 | blk_put_request(next_rq); | 319 | blk_put_request(next_rq); |
319 | } | 320 | } |
320 | return ERR_PTR(ret); | 321 | return ERR_PTR(ret); |
@@ -448,6 +449,7 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr, | |||
448 | hdr->dout_resid = rq->data_len; | 449 | hdr->dout_resid = rq->data_len; |
449 | hdr->din_resid = rq->next_rq->data_len; | 450 | hdr->din_resid = rq->next_rq->data_len; |
450 | blk_rq_unmap_user(bidi_bio); | 451 | blk_rq_unmap_user(bidi_bio); |
452 | rq->next_rq->bio = NULL; | ||
451 | blk_put_request(rq->next_rq); | 453 | blk_put_request(rq->next_rq); |
452 | } else if (rq_data_dir(rq) == READ) | 454 | } else if (rq_data_dir(rq) == READ) |
453 | hdr->din_resid = rq->data_len; | 455 | hdr->din_resid = rq->data_len; |
@@ -466,6 +468,7 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr, | |||
466 | blk_rq_unmap_user(bio); | 468 | blk_rq_unmap_user(bio); |
467 | if (rq->cmd != rq->__cmd) | 469 | if (rq->cmd != rq->__cmd) |
468 | kfree(rq->cmd); | 470 | kfree(rq->cmd); |
471 | rq->bio = NULL; | ||
469 | blk_put_request(rq); | 472 | blk_put_request(rq); |
470 | 473 | ||
471 | return ret; | 474 | return ret; |