summaryrefslogtreecommitdiffstats
path: root/drivers/staging/omapdrm
diff options
context:
space:
mode:
authorVincent Penquerc'h2012-10-09 20:40:39 +0200
committerGreg Kroah-Hartman2012-10-23 00:41:09 +0200
commit23d84ed9c81b6f09c270da00b00e8582fab7ca70 (patch)
treef09249fb6ad3edae60dbf4bfdb0e266ed8ac1d05 /drivers/staging/omapdrm
parentstaging: zram: Fix handling of incompressible pages (diff)
downloadkernel-qcow2-linux-23d84ed9c81b6f09c270da00b00e8582fab7ca70.tar.gz
kernel-qcow2-linux-23d84ed9c81b6f09c270da00b00e8582fab7ca70.tar.xz
kernel-qcow2-linux-23d84ed9c81b6f09c270da00b00e8582fab7ca70.zip
staging: omapdrm: fix allocation size for page addresses array
Signed-off-by: Rob Clark <rob@ti.com> Signed-off-by: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/omapdrm')
-rw-r--r--drivers/staging/omapdrm/omap_gem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/omapdrm/omap_gem.c b/drivers/staging/omapdrm/omap_gem.c
index 3434e6ec0142..66e2c2f8a239 100644
--- a/drivers/staging/omapdrm/omap_gem.c
+++ b/drivers/staging/omapdrm/omap_gem.c
@@ -246,7 +246,7 @@ static int omap_gem_attach_pages(struct drm_gem_object *obj)
* DSS, GPU, etc. are not cache coherent:
*/
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) {
ret = -ENOMEM;
goto free_pages;
@@ -257,7 +257,7 @@ static int omap_gem_attach_pages(struct drm_gem_object *obj)
0, PAGE_SIZE, DMA_BIDIRECTIONAL);
}
} else {
- addrs = kzalloc(npages * sizeof(addrs), GFP_KERNEL);
+ addrs = kzalloc(npages * sizeof(*addrs), GFP_KERNEL);
if (!addrs) {
ret = -ENOMEM;
goto free_pages;