[PATCH] drm/exynos: fix pages allocation in lowlevel_buffer_allocate

Seung-Woo Kim sw0312.kim at samsung.com
Tue Jul 2 03:59:22 PDT 2013


From: YoungJun Cho <yj44.cho at samsung.com>

When drm iommu is not supported, buf->pages has to be allocated
and assigned to phys_to_page() result, which type is struct page *.
So it is sufficient to allocate buf->pages with multiple struct
page pointer size.

Signed-off-by: YoungJun Cho <yj44.cho at samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_buf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_buf.c b/drivers/gpu/drm/exynos/exynos_drm_buf.c
index 22865ba..3200622 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_buf.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_buf.c
@@ -57,7 +57,7 @@ static int lowlevel_buffer_allocate(struct drm_device *dev,
 		dma_addr_t start_addr;
 		unsigned int i = 0;
 
-		buf->pages = kzalloc(sizeof(struct page) * nr_pages,
+		buf->pages = kzalloc(sizeof(struct page *) * nr_pages,
 					GFP_KERNEL);
 		if (!buf->pages) {
 			DRM_ERROR("failed to allocate pages.\n");
-- 
1.7.9.5



More information about the dri-devel mailing list