summaryrefslogtreecommitdiffstats
path: root/drivers/lightnvm
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavo@embeddedor.com>2018-12-22 08:39:52 +0100
committerJens Axboe <axboe@kernel.dk>2018-12-22 22:45:35 +0100
commitd52c499b476b2f82eebecdd5fc4be8318a4e8ef7 (patch)
tree008a2e96639d548172271d76bf7d9a8a343d69ed /drivers/lightnvm
parentblock: sunvdc: remove redundant code (diff)
downloadlinux-d52c499b476b2f82eebecdd5fc4be8318a4e8ef7.tar.xz
linux-d52c499b476b2f82eebecdd5fc4be8318a4e8ef7.zip
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>
Diffstat (limited to 'drivers/lightnvm')
-rw-r--r--drivers/lightnvm/pblk-recovery.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c
index 3fcf062d752c..5ee20da7bdb3 100644
--- a/drivers/lightnvm/pblk-recovery.c
+++ b/drivers/lightnvm/pblk-recovery.c
@@ -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;
}