Skip to contentSkip to conversation

drm: fix memory leak in msm_gem when no iommu is present

PATCH In review Micah Richert 2 participants 2 messages Apr 14, 2014

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

PATCH 1/1 drm: fix memory leak in msm_gem when no iommu is present

---
 drivers/gpu/drm/msm/msm_gem.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/msm_gem.c +3 -1
index e8458bc..c818a06 100644
@@ -118,8 +118,10 @@ static void put_pages(struct drm_gem_object *obj)
 
 		if (iommu_present(&platform_bus_type))
 			drm_gem_put_pages(obj, msm_obj->pages, true, false);
-		else
+		else {
 			drm_mm_remove_node(msm_obj->vram_node);
+			drm_free_large(msm_obj->pages);
+		}
 
 		msm_obj->pages = NULL;
 	}
Signature · 1 line
1.8.3.2
#1 lore raw

fyi, I have this patch applied locally (well, actually the previous one with slightly amended subject line).. was just waiting a bit to see if any other fixes turned up before sending a fixes pull. Thanks!

BR,
-R

Quoted 24 lines · Micah Richert
---
 drivers/gpu/drm/msm/msm_gem.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/msm_gem.c +3 -2
index e8458bc..c818a06 100644
@@ -118,8 +118,10 @@ static void put_pages(struct drm_gem_object *obj)
 
                if (iommu_present(&platform_bus_type))
                        drm_gem_put_pages(obj, msm_obj->pages, true, false);
-               else
+               else {
                        drm_mm_remove_node(msm_obj->vram_node);
+                       drm_free_large(msm_obj->pages);
+               }
 
                msm_obj->pages = NULL;
        }
--

1.8.3.2