[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1454594228-18970-2-git-send-email-m@bjorling.me>
Date: Thu, 4 Feb 2016 14:57:04 +0100
From: Matias Bjørling <m@...rling.me>
To: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
axboe@...com
Cc: Wenwei Tao <ww.tao0320@...il.com>
Subject: [PATCH 1/5] lightnvm: put bio before return
From: Wenwei Tao <ww.tao0320@...il.com>
The bio is not returned if the data page cannot be allocated.
Signed-off-by: Wenwei Tao <ww.tao0320@...il.com>
---
drivers/lightnvm/rrpc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c
index c4d0b04..775bf6c2 100644
--- a/drivers/lightnvm/rrpc.c
+++ b/drivers/lightnvm/rrpc.c
@@ -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) {
--
2.1.4
Powered by blists - more mailing lists