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-next>] [day] [month] [year] [list]
Date:	Sat, 29 Nov 2014 09:31:57 +0800
From:	Zeng Tao <prime.zeng@...wei.com>
To:	<gregkh@...uxfoundation.org>, <john.stultz@...aro.org>,
	<ccross@...roid.com>, <benjamin.gaignard@...aro.org>,
	<rebecca@...roid.com>, <fabio.estevam@...escale.com>
CC:	<devel@...verdev.osuosl.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] staging: ion : ion_cma_heap: fix bug for highmem cma

when cma is located in highmem, virt_to_page will not
work the right way, use pfn_to_page instead.

Signed-off-by: Zeng Tao <prime.zeng@...wei.com>
---
 drivers/staging/android/ion/ion_cma_heap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/ion/ion_cma_heap.c b/drivers/staging/android/ion/ion_cma_heap.c
index f8cabcb..cc45fc0 100644
--- a/drivers/staging/android/ion/ion_cma_heap.c
+++ b/drivers/staging/android/ion/ion_cma_heap.c
@@ -47,7 +47,7 @@ struct ion_cma_buffer_info {
 static int ion_cma_get_sgtable(struct device *dev, struct sg_table *sgt,
 			       void *cpu_addr, dma_addr_t handle, size_t size)
 {
-	struct page *page = virt_to_page(cpu_addr);
+	struct page *page = pfn_to_page(handle >> PAGE_SHIFT);
 	int ret;
 
 	ret = sg_alloc_table(sgt, 1, GFP_KERNEL);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists