lightnvm: pblk: fix use-after-free bug

Remove one of the calls to function bio_put(), so *bio* is only
freed once.

Notice that bio is being dereferenced in bio_put(), hence leading to
a use-after-free bug once *bio* has already been freed.

Addresses-Coverity-ID: 1475952 ("Use after free")
Fixes: 55d8ec3539 ("lightnvm: pblk: support packed metadata")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Gustavo A. R. Silva 2018-12-22 01:39:52 -06:00 committed by Jens Axboe
parent 93f87a74fd
commit d52c499b47
1 changed files with 0 additions and 1 deletions

View File

@ -418,7 +418,6 @@ retry_rq:
if (ret) {
pblk_err(pblk, "I/O submission failed: %d\n", ret);
bio_put(bio);
bio_put(bio);
return ret;
}