Skip to contentSkip to conversation

drm/i915: Fix object refcount leak on mmappable size limit error path.

PATCH In review Eric Anholt 2 participants 4 messages Nov 1, 2011

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

PATCH 1/1 drm/i915: Fix object refcount leak on mmappable size limit error path.

I've been seeing memory leaks on my system in the form of large (300-400MB) GEM objects created by now-dead processes laying around clogging up memory. I usually notice when it gets to about 1.2GB of them. Hopefully this clears up the issue, but I just found this bug by inspection.

---
 drivers/gpu/drm/i915/i915_gem.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +1 -1
index 6c69cfa..ee78c8e 100644
@@ -1477,7 +1477,7 @@ i915_gem_mmap_gtt(struct drm_file *file,
 
 	if (obj->base.size > dev_priv->mm.gtt_mappable_end) {
 		ret = -E2BIG;
-		goto unlock;
+		goto out;
 	}
 
 	if (obj->madv != I915_MADV_WILLNEED) {
Signature · 1 line
1.7.7
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Eric Anholt

I've been seeing memory leaks on my system in the form of large (300-400MB) GEM objects created by now-dead processes laying around clogging up memory. I usually notice when it gets to about 1.2GB of them. Hopefully this clears up the issue, but I just found this bug by inspection.

I wouldn't mind having someone audit the driver for more places where drm_gem_object_lookup might not be paired with drm_gem_object_unreference...

Signature · 1 line
[email protected]
#2 lore raw

On Mon, 31 Oct 2011 23:58:25 -0700, Keith Packard <[email protected]> wrote:
Non-text part: multipart/signed

Quoted 8 lines · Eric Anholt
Quoted 7 lines

I've been seeing memory leaks on my system in the form of large (300-400MB) GEM objects created by now-dead processes laying around clogging up memory. I usually notice when it gets to about 1.2GB of them. Hopefully this clears up the issue, but I just found this bug by inspection.

Quoted 7 lines
Quoted 2 lines

I wouldn't mind having someone audit the driver for more places where drm_gem_object_lookup might not be paired with drm_gem_object_unreference...

I went ahead and finished the read-through, and everything else looks good.

#3 lore raw
Quoted 2 lines · Eric Anholt

I went ahead and finished the read-through, and everything else looks good.

Thanks. I've merged your patch locally; it's on top of a couple of patches that need some work, so I'll reorder stuff and push this out today.

Signature · 1 line
[email protected]