diff options
| author | Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> | 2012-10-09 14:40:39 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-22 18:41:09 -0400 |
| commit | 23d84ed9c81b6f09c270da00b00e8582fab7ca70 (patch) | |
| tree | f09249fb6ad3edae60dbf4bfdb0e266ed8ac1d05 | |
| parent | c8f2f0db1d0294aaf37e8a85bea9bbc4aaf5c0fe (diff) | |
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>
| -rw-r--r-- | drivers/staging/omapdrm/omap_gem.c | 4 |
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) | |||
| 246 | * DSS, GPU, etc. are not cache coherent: | 246 | * DSS, GPU, etc. are not cache coherent: |
| 247 | */ | 247 | */ |
| 248 | if (omap_obj->flags & (OMAP_BO_WC|OMAP_BO_UNCACHED)) { | 248 | if (omap_obj->flags & (OMAP_BO_WC|OMAP_BO_UNCACHED)) { |
| 249 | addrs = kmalloc(npages * sizeof(addrs), GFP_KERNEL); | 249 | addrs = kmalloc(npages * sizeof(*addrs), GFP_KERNEL); |
| 250 | if (!addrs) { | 250 | if (!addrs) { |
| 251 | ret = -ENOMEM; | 251 | ret = -ENOMEM; |
| 252 | goto free_pages; | 252 | goto free_pages; |
| @@ -257,7 +257,7 @@ static int omap_gem_attach_pages(struct drm_gem_object *obj) | |||
| 257 | 0, PAGE_SIZE, DMA_BIDIRECTIONAL); | 257 | 0, PAGE_SIZE, DMA_BIDIRECTIONAL); |
| 258 | } | 258 | } |
| 259 | } else { | 259 | } else { |
| 260 | addrs = kzalloc(npages * sizeof(addrs), GFP_KERNEL); | 260 | addrs = kzalloc(npages * sizeof(*addrs), GFP_KERNEL); |
| 261 | if (!addrs) { | 261 | if (!addrs) { |
| 262 | ret = -ENOMEM; | 262 | ret = -ENOMEM; |
| 263 | goto free_pages; | 263 | goto free_pages; |
