Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1628807
| From | Matias Bjørling <mb@lightnvm.io> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 3/5] lightnvm: pblk: fix memory leak on error path |
| Date | 2017-04-22 11:00 +0200 |
| Message-ID | <tyZ3z-DT-5@gated-at.bofh.it> (permalink) |
| References | <tyQjD-3De-3@gated-at.bofh.it> <tyQjE-3De-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 04/22/2017 01:32 AM, Javier González wrote:
> When write recovery fails, Free memory for the recovery structure.
>
> Fixes: a4bd217b4326 "lightnvm: physical block device (pblk) target"
>
> Signed-off-by: Javier González <javier@cnexlabs.com>
> ---
> drivers/lightnvm/pblk-write.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/lightnvm/pblk-write.c b/drivers/lightnvm/pblk-write.c
> index 74f7413..a896190 100644
> --- a/drivers/lightnvm/pblk-write.c
> +++ b/drivers/lightnvm/pblk-write.c
> @@ -142,6 +142,7 @@ static void pblk_end_w_fail(struct pblk *pblk, struct nvm_rq *rqd)
> /* Logic error */
> if (bit > c_ctx->nr_valid) {
> WARN_ONCE(1, "pblk: corrupted write request\n");
> + mempool_free(recovery, pblk->rec_pool);
> goto out;
> }
>
> @@ -149,6 +150,7 @@ static void pblk_end_w_fail(struct pblk *pblk, struct nvm_rq *rqd)
> entry = pblk_rb_sync_scan_entry(&pblk->rwb, &ppa);
> if (!entry) {
> pr_err("pblk: could not scan entry on write failure\n");
> + mempool_free(recovery, pblk->rec_pool);
> goto out;
> }
>
> @@ -162,6 +164,7 @@ static void pblk_end_w_fail(struct pblk *pblk, struct nvm_rq *rqd)
> ret = pblk_recov_setup_rq(pblk, c_ctx, recovery, comp_bits, c_entries);
> if (ret) {
> pr_err("pblk: could not recover from write failure\n");
> + mempool_free(recovery, pblk->rec_pool);
> goto out;
> }
>
>
Reviewed-by: Matias Bjørling <matias@cnexlabs.com>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/5] lightnvm: pblk extra patches for 4.12 "Javier González" <jg@lightnvm.io> - 2017-04-22 01:40 +0200
[PATCH 4/5] lightnvm: pblk: free metadata on line alloc failure "Javier González" <jg@lightnvm.io> - 2017-04-22 01:40 +0200
Re: [PATCH 4/5] lightnvm: pblk: free metadata on line alloc failure Matias Bjørling <mb@lightnvm.io> - 2017-04-22 11:10 +0200
[PATCH 3/5] lightnvm: pblk: fix memory leak on error path "Javier González" <jg@lightnvm.io> - 2017-04-22 01:40 +0200
Re: [PATCH 3/5] lightnvm: pblk: fix memory leak on error path Matias Bjørling <mb@lightnvm.io> - 2017-04-22 11:00 +0200
Re: [PATCH 0/5] lightnvm: pblk extra patches for 4.12 Matias Bjørling <mb@lightnvm.io> - 2017-04-23 20:10 +0200
Re: [PATCH 0/5] lightnvm: pblk extra patches for 4.12 Jens Axboe <axboe@kernel.dk> - 2017-04-24 01:10 +0200
csiph-web