Skip to contentSkip to conversation

drm/i915: Plug memory leak in intel_shared_dpll_start_config()

PATCH Applied Ander Conselvan de Oliveira 3 participants 3 messages Nov 7, 2014 – Nov 11, 2014

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

PATCH 1/1 drm/i915: Plug memory leak in intel_shared_dpll_start_config()

The cleanup path would reset pll->new_config to NULL but wouldn't free the allocated memory.

---
 drivers/gpu/drm/i915/intel_display.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/intel_display.c +1 -0
index 339e94f..7e2e4d1 100644
@@ -3940,6 +3940,7 @@ static int intel_shared_dpll_start_config(struct drm_i915_private *dev_priv,
 cleanup:
 	while (--i >= 0) {
 		pll = &dev_priv->shared_dplls[i];
+		kfree(pll->new_config);
 		pll->new_config = NULL;
 	}
 
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#1 lore raw

2014-11-07 10:07 GMT-02:00 Ander Conselvan de Oliveira <[email protected]>:

Quoted 2 lines

The cleanup path would reset pll->new_config to NULL but wouldn't free the allocated memory.

Quoted 25 lines
---
 drivers/gpu/drm/i915/intel_display.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/intel_display.c +1 -1
index 339e94f..7e2e4d1 100644
@@ -3940,6 +3940,7 @@ static int intel_shared_dpll_start_config(struct drm_i915_private *dev_priv,
 cleanup:
        while (--i >= 0) {
                pll = &dev_priv->shared_dplls[i];
+               kfree(pll->new_config);
                pll->new_config = NULL;
        }
 
--

1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 5 lines
Paulo Zanoni
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
Quoted 6 lines · Paulo Zanoni

2014-11-07 10:07 GMT-02:00 Ander Conselvan de Oliveira <[email protected]>:

Quoted 2 lines

The cleanup path would reset pll->new_config to NULL but wouldn't free the allocated memory.

Queued for -next, thanks for the patch.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx