Skip to contentSkip to conversation

drm/omap: fix allocation size for page addresses array

PATCH In review Vincent Penquerc'h 2 participants 2 messages Oct 9, 2012 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/omap: fix allocation size for page addresses array

---
 drivers/staging/omapdrm/omap_gem.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/omapdrm/omap_gem.c +2 -2
index c828743..4c1472c 100644
@@ -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;
Signature · 1 line
1.7.9.5
maintainer
#1 lore raw
Quoted 4 lines · Vincent Penquerc'h
---
 drivers/staging/omapdrm/omap_gem.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Having a patch "From:" someone else is fine, but please get a signed-off-by from them as well.

Care to resend?

Also, take a look at Documentation/SubmittingPatches which shows how to put the "From:" line in the body of the changelog area so that the From:
part shows up correctly when I commit it.

thanks,

greg k-h