Skip to contentSkip to conversation

drm: fix drm_local_map allocation size

PATCH RESEND In review Jani Nikula 1 participant 2 messages Feb 12, 2013 – Apr 3, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 drm: fix drm_local_map allocation size

list->map is struct drm_local_map *, not struct drm_map_list *.

---

Found this small snippet laying around, I guess it fell between the cracks.

---
 drivers/gpu/drm/drm_gem.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_gem.c +1 -1
index 24efae4..6337edd 100644
@@ -343,7 +343,7 @@ drm_gem_create_mmap_offset(struct drm_gem_object *obj)
 
 	/* Set the object up for mmap'ing */
 	list = &obj->map_list;
-	list->map = kzalloc(sizeof(struct drm_map_list), GFP_KERNEL);
+	list->map = kzalloc(sizeof(*list->map), GFP_KERNEL);
 	if (!list->map)
 		return -ENOMEM;
 
Signature · 1 line
1.7.9.5
#1 lore raw

ping

Quoted 26 lines · Jani Nikula

list->map is struct drm_local_map *, not struct drm_map_list *.

---

Found this small snippet laying around, I guess it fell between the cracks.

---
 drivers/gpu/drm/drm_gem.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_gem.c +1 -1
index 24efae4..6337edd 100644
@@ -343,7 +343,7 @@ drm_gem_create_mmap_offset(struct drm_gem_object *obj)
 
 	/* Set the object up for mmap'ing */
 	list = &obj->map_list;
-	list->map = kzalloc(sizeof(struct drm_map_list), GFP_KERNEL);
+	list->map = kzalloc(sizeof(*list->map), GFP_KERNEL);
 	if (!list->map)
 		return -ENOMEM;
 
Signature · 1 line
1.7.9.5