lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1461681318-29571-3-git-send-email-javier@javigon.com>
Date:	Tue, 26 Apr 2016 16:35:18 +0200
From:	"Javier González" <jg@...htnvm.io>
To:	mb@...htnvm.io
Cc:	linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
	Javier González <javier@...xlabs.com>
Subject: [PATCH 1/2] lightnvm: free metadata dma on rrpc when needed

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@...xlabs.com>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ