[PATCH 1/6] drm/omap: Fix memory leak in omap_gem_op_async

Archit Taneja archit at ti.com
Fri Apr 11 00:23:30 PDT 2014


From: Subhajit Paul <subhajit_paul at ti.com>

In omap_gem_op_async(), if a waiter is not added to the wait list, it needs to
be free'd in the function itself.

Make sure we free the waiter for this case.

Signed-off-by: Subhajit Paul <subhajit_paul at ti.com>
Signed-off-by: Archit Taneja <archit at ti.com>
---
 drivers/gpu/drm/omapdrm/omap_gem.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c
index 5aec3e8..3199e3f 100644
--- a/drivers/gpu/drm/omapdrm/omap_gem.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem.c
@@ -1229,6 +1229,8 @@ int omap_gem_op_async(struct drm_gem_object *obj, enum omap_gem_op op,
 		}
 
 		spin_unlock(&sync_lock);
+
+		kfree(waiter);
 	}
 
 	/* no waiting.. */
-- 
1.8.3.2



More information about the dri-devel mailing list