lightnvm: pblk: fix use-after-free bug
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Sat, 22 Dec 2018 07:39:52 +0000 (01:39 -0600)
committerJens Axboe <axboe@kernel.dk>
Sat, 22 Dec 2018 21:45:35 +0000 (14:45 -0700)
commitd52c499b476b2f82eebecdd5fc4be8318a4e8ef7
tree008a2e96639d548172271d76bf7d9a8a343d69ed
parent93f87a74fde682e0b53c90ea25e744003d294ae2
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: 55d8ec35398e ("lightnvm: pblk: support packed metadata")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/pblk-recovery.c