Skip to content

Commit

Permalink
lightnvm: put bio before return
Browse files Browse the repository at this point in the history
The bio is not returned if the data page cannot be allocated.

Signed-off-by: Wenwei Tao <ww.tao0320@gmail.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Wenwei Tao authored and Jens Axboe committed Feb 4, 2016
1 parent e502fb8 commit 16c6d04
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/lightnvm/rrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,10 @@ static int rrpc_move_valid_pages(struct rrpc *rrpc, struct rrpc_block *rblk)
}

page = mempool_alloc(rrpc->page_pool, GFP_NOIO);
if (!page)
if (!page) {
bio_put(bio);
return -ENOMEM;
}

while ((slot = find_first_zero_bit(rblk->invalid_pages,
nr_pgs_per_blk)) < nr_pgs_per_blk) {
Expand Down

0 comments on commit 16c6d04

Please sign in to comment.