summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_sprite.c
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2012-06-27 00:55:37 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-06-27 17:03:24 +0200
commita8b0bbabf756bfb45a712b823ba41f5c95f85589 (patch)
tree5e2863cae804bede05f1589b357a88345dbb04d1 /drivers/gpu/drm/i915/intel_sprite.c
parentf4d71056482f0c3306aa752fd626883f60deed96 (diff)
downloadtalos-op-linux-a8b0bbabf756bfb45a712b823ba41f5c95f85589.tar.gz
talos-op-linux-a8b0bbabf756bfb45a712b823ba41f5c95f85589.zip
drm/i915/sprite: Fix mem leak in intel_plane_init()
If we ever hit the default case in the switch statement we'll return from the function without freeing the memory we just allocated to 'intel_plane' (but that has not been used). This patch gets rid of the leak by freeing the memory just before we return. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_sprite.c')
-rw-r--r--drivers/gpu/drm/i915/intel_sprite.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index b04109789f2e..1a1483b924d0 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -691,6 +691,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe)
break;
default:
+ kfree(intel_plane);
return -ENODEV;
}
@@ -705,4 +706,3 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe)
return ret;
}
-
OpenPOWER on IntegriCloud