提交 23d84ed9 编写于 作者: V Vincent Penquerc'h 提交者: Greg Kroah-Hartman

staging: omapdrm: fix allocation size for page addresses array

Signed-off-by: NRob Clark <rob@ti.com>
Signed-off-by: NVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 c8f2f0db
...@@ -246,7 +246,7 @@ static int omap_gem_attach_pages(struct drm_gem_object *obj) ...@@ -246,7 +246,7 @@ static int omap_gem_attach_pages(struct drm_gem_object *obj)
* DSS, GPU, etc. are not cache coherent: * DSS, GPU, etc. are not cache coherent:
*/ */
if (omap_obj->flags & (OMAP_BO_WC|OMAP_BO_UNCACHED)) { if (omap_obj->flags & (OMAP_BO_WC|OMAP_BO_UNCACHED)) {
addrs = kmalloc(npages * sizeof(addrs), GFP_KERNEL); addrs = kmalloc(npages * sizeof(*addrs), GFP_KERNEL);
if (!addrs) { if (!addrs) {
ret = -ENOMEM; ret = -ENOMEM;
goto free_pages; goto free_pages;
...@@ -257,7 +257,7 @@ static int omap_gem_attach_pages(struct drm_gem_object *obj) ...@@ -257,7 +257,7 @@ static int omap_gem_attach_pages(struct drm_gem_object *obj)
0, PAGE_SIZE, DMA_BIDIRECTIONAL); 0, PAGE_SIZE, DMA_BIDIRECTIONAL);
} }
} else { } else {
addrs = kzalloc(npages * sizeof(addrs), GFP_KERNEL); addrs = kzalloc(npages * sizeof(*addrs), GFP_KERNEL);
if (!addrs) { if (!addrs) {
ret = -ENOMEM; ret = -ENOMEM;
goto free_pages; goto free_pages;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册