[PATCH 1/2] lightnvm: free metadata dma on rrpc when needed
From: Javier GonzÃlez
Date: Tue Apr 26 2016 - 10:36:04 EST
rrpc has assumed that medatada is always sent as a dma buffer to the
device. When this is not true, do not attempt to free a non-allocated
dma region.
Signed-off-by: Javier GonzÃlez <javier@xxxxxxxxxxxx>
---
drivers/lightnvm/rrpc.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c
index a9a5fcc..ba789c3 100644
--- a/drivers/lightnvm/rrpc.c
+++ b/drivers/lightnvm/rrpc.c
@@ -707,10 +707,12 @@ static void rrpc_end_io(struct nvm_rq *rqd)
rrpc_unlock_rq(rrpc, rqd);
- if (npages > 1)
+ if (npages > 1) {
nvm_dev_dma_free(rrpc->dev, rqd->ppa_list, rqd->dma_ppa_list);
- if (rqd->metadata)
- nvm_dev_dma_free(rrpc->dev, rqd->metadata, rqd->dma_metadata);
+ if (rqd->meta_list)
+ nvm_dev_dma_free(rrpc->dev, rqd->meta_list,
+ rqd->dma_meta_list);
+ }
mempool_free(rqd, rrpc->rq_pool);
}
--
2.5.0